hi,
string test1; byte[] test2;
It is posible to convert or parse string to byte array in C#?
thanks...
Popskie
Printable View
hi,
string test1; byte[] test2;
It is posible to convert or parse string to byte array in C#?
thanks...
Popskie
I think you need to use the encoding classes: like this:
HTH, StephanCode:string test = "Hello World";
byte [] myByte = Encoding.UTF8.GetBytes(test);
hmm I would do Ascii.getbytes
why utf8? I dont even know what it is:D
MrPolite is correct there is no utf8 but my problem didnt get here. Ok i explain what i need here. First i hve a fieldtype image. When i retrieve that table my image field is save to listview subitem as string. when the user click that subitem i want to convert that string to byte[] in order to view that image but i got an error here . The error is invalid parameter used or invalid cast. What the problem. I already convert into byte[] but the error stil der.