Converting ASCII to HEX
Posted on 2007-08-01
I am recieving a serial stream of characters in ASCII, and once I have a valid string of these ASCII characters, I need to convert them to HEX.
I have created a sample app, with a sample string, but it doesn't work. It only converts the First ASCII character to HEX, and ignores the rest.
What do I need to do to convert all of the characters?
Here is my sample app:
Public Class AYFSMain
Dim DelphiString As String = "ñ]¬ªªUUwwE"
Dim DelphiStringHex As String = Hex(Asc(DelphiString))
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show(DelphiStringHex, "Result", MessageBoxButtons.OK, MessageBoxIcon.Information)