This is a total noob question that I can't seem to find the answer to. I have a csv file that contains CAN frames. The frames look like this.
0.10836,1,181,2,8,6d,3d,05,00,28,00,54,12,1
Obviously this is hex. How can I read this into C# from the file as hex and not the ASCII equivalent?
I've tried using File.ReadAllBytes like this:
byte[] baFileLineArray = File.ReadAllBytes(sFileName);
And then a debug output like this:
foreach (byte ByteElement in baFileLineArray)
{
if (ByteElement == 0x2c)
{
Console.Write(Environment.NewLine);
}
else
{
Console.Write("{0:x} ", ByteElement);
}
}
Which produces the following output:

I need the information to be read as hex and not as an ASCII character. so for instance, the first from last field is 0x12, and the third from last is 0x54. Not 0x35 0x34.
Thanks So Much!!