I need to copy the strings from text box to struct. is there any way to do it? here's what am trying:
and also other way round. its not working.. :( any help greatly appreciated
Code:
public unsafe struct mystruc
{
public byte[] install_name; // size limit 32 bytes
public byte[] install_id; // size limit 4 bytes
public byte[] model_name; // size limit 4 bytes
};
private void read_b_Click(object sender, EventArgs e)
{
mystruc mstruc1 = new mystruc();
//copy from textbox to struct
mstruc.install_name = Encoding.UTF8.GetBytes(installation_name_tb.Text);
mstruc.install_id = Encoding.UTF8.GetBytes(installation_id_tb.Text);
mstruc.model_name = Encoding.UTF8.GetBytes(model_tb.Text);
}
Comment