473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to copy from text box to struct C#

I need to copy the strings from text box to struct. is there any way to do it? here's what am trying:
Expand|Select|Wrap|Line Numbers
  1.     public unsafe struct mystruc
  2.     {
  3.         public fixed byte[] install_name[32]; 
  4.         public byte[] fixed install_id[4];limit 4 bytes
  5.         public fixed byte[] model_name[6]; limit 4 bytes
  6.     };
  7.  
  8.     private void write_b_Click(object sender, EventArgs e)
  9.     {
  10.         mystruc mstruc1 = new mystruc();
  11.  
  12.         //copy from textbox to struct    
  13. mstruc.install_name =Encoding.UTF8.GetBytes(installation_name_tb.Text);
  14.  
  15. mstruc.install_id =Encoding.UTF8.GetBytes(installation_id_tb.Text);
  16.         mstruc.model_name = Encoding.UTF8.GetBytes(model_tb.Text);    
  17.     }
  18.  
and also other way round. its not working.. :( any help greatly appreciated
Oct 29 '10 #1
0 966

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Meikel | last post by:
I created a ClipboardUtils class which makes it easy to copy Strings or images to the clipboard. I don't claim that it's no way perfect, but has been useful in my applications so far. If you try...
0
by: DL | last post by:
Can somebody tell met how to copy text from a control item to a textbox by pressing a button. control item is in this case a pdf document. ( don't know if you name it like this but it sounds...
5
by: Dave Vick | last post by:
OK, I've got a requirment to copy some content from an HTML page. It is a failry lengthy page and we want to give the user/reader the ability to click a button and have a section of the page copied...
3
by: worzel | last post by:
need some simple code to copy text to clipboard in c# - my app has right click > copy to clicpboard feature, which is best way to do this?
9
by: Michael | last post by:
Hi all, I want to copy a structure, but the only thing I have is a pointer to it. Whats good here? Because the structure contains no pointers, but arrays and variables I thought of doing a...
2
by: Jay | last post by:
Is there a way to copy text that is always in the same place in a word document, (such as an id number in my case) and then paste it into a text box in another program? I've tried various...
1
by: Miljana Murgas | last post by:
I have a struct like this: public struct Vec { public float m; public Vec(float v1, float v2) { m = new float; m=v1; m=v2; }
1
by: onlivimal | last post by:
hi, i have a problem copying two struct data. struct Details { public: char Title; char Artist; int noSongs; float Price; ...
10
by: Sillu | last post by:
I'ld like to create a web page, from which no one can select the text simply, copy frm there n paste at another location. In simple means, i'ld like to stop copy process from my web page. Plz...
0
by: Robert | last post by:
Hi! I want to fill the clipboard programmatically in oder to manual copy the data to word. The data consists of cells of a grid which contains text or images. Using the standard copy/paste of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.