Alan,
Here is some code
string myString = "abcd";
System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
byte[] ba = ascii.GetBytes(myString);
string myString0 = "";
string myString1 = "";
for (int i = 0 ; i < ba.Length ; i++)
{
myString0 += ba[i].ToString("X2") + " ";
myString1 += "0x"+ba[i].ToString("X2")+" ";
}
MessageBox.Show(myString0 + Environment.NewLine +myString1);
Hope this is kinda what you were looking for or atleast put you on the right track.
Please let me know if I misunderstood.
Einar
>I want to build a string of characters, similar to a UPC code. Then convert those characters into a string of equivilant Hexa-decimal bytes (in test) each seperated by a space. I need it this way to pass it to some RFID hardware.
>
>Is there a pre-built class in C# that can convert the ASCII character to a HEX string? If not, does anyone have a way to accomplish this?
>
>thanks
>
>Alan Wyne
Semper ubi sub ubi.