How to convert char
to ASCII
and display in textbox in C#
?
For Eg :
i have char a
and i want to convert this to ASCII-code 95
and display it in textbox
.
noted : tools = visual Studio express edition 2010
How to convert char
to ASCII
and display in textbox in C#
?
For Eg :
i have char a
and i want to convert this to ASCII-code 95
and display it in textbox
.
noted : tools = visual Studio express edition 2010
Try
int AsciCode = (int)'c';
string AsciStr = AsciCode.ToString();
hope it helps
You can do something like this;
string value = "a";
// Convery your string to ascii.
byte[] asciiBytes = Encoding.ASCII.GetBytes(value);
Hope it helps.
Try This One
Char chr = 'a';
int Ascii = chr;
TextBox1.Text(Ascii.ToString());