How to convert the string to byte in c# ?

  • Thread starter Thread starter Ghanshyam Singh
  • Start date Start date
G

Ghanshyam Singh

Guest
hello C# gurus,

i am trying to convert string to byte using this code, but it gives error pls help me..




public

static byte[] StringToByte(string InString) {

string[] ByteStrings;

ByteStrings = InString.Split(" ".ToCharArray());

byte[] ByteOut;

ByteOut =
new byte[ByteStrings.Length-1];

for (int i = 0;i==ByteStrings.Length-1;i++) {

ByteOut
emotion-55.gif
= Convert.ToByte(("0x" + ByteStrings
emotion-55.gif
));

}

return ByteOut;

}


Continue reading...
 
Back
Top