简体   繁体   中英

How do I convert a character to a hex value in vb.net

Not a string, just a keyboard character in a text box. So i don't want this code.

For each c as char in textbox1.text

Next

I want to simply know the code for converting a single character in the text box, one at a time.

A single character in a textbox will still end up as a string. Once you've checked that the string has a length of 1, you can convert it to a char by getting the first (only) char in the string:

char theCharacter = stringFromTextbox[0];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM