I used VB before I quickly got this desired result:
DIM Ascstr as string = asc (TextBox.text (0))
But I used C #, which seems simple to this seem simpler, and I have exhausted my brain.
String ascstr = (int) textbox1.text [0];
Can deal with Abcd ..... and _ (), but there is no way to "I, you, he", don't believe you try:
Compare VB's ASC - C # INT value: VB (ASC) I: -12590C # (int) me: 25105, minus (2 ^ 16 = 65536) is: -40431 cry ... I Reading, can't find, see help. But C # does trouble, a lot of things don't know, what asciiencoding, the result is 63, explaining the encoding that cannot be identified, this is good, as long as it is Chinese, all 63, try UTF8, Unicode, really unknown Cloud, usually too unfamiliar with the encoding. Finally, use the Encoding class, but it still can't get the result. Find ah, find ...
Encoding ecode = encoding.getencoding ("GB18030"); start writing code:
Encoding ecode = encoding.getencoding ("GB18030"); Byte [] codebytes = ecode.getbytes (chr.tostring ()); messagebox.show (codeBytes [0] .tostring ()); result got a hundred digits Value, no. Suddenly I thought that the Chinese words were double-bytes, and they used a function to judge whether the character is double byte ///
If anyone knows, let's tell. But it doesn't matter, I am enough for my scenery.