How to get ASCII value of string in C#
From MSDN
string value = "9quali52ty3";
// Convert the string into a byte[].
byte[] asciiBytes = Encoding.ASCII.GetBytes(value);
You now have an array of the ASCII value of the bytes. I got the following:
57 113 117 97 108 105 53 50 116 121 51
string s = "9quali52ty3";
foreach(char c in s)
{
Console.WriteLine((int)c);
}
This should work:
string s = "9quali52ty3";
byte[] ASCIIValues = Encoding.ASCII.GetBytes(s);
foreach(byte b in ASCIIValues) {
Console.WriteLine(b);
}