I have a string of ASCII in HEX. ( 5A65726f)
so first i split them into 2s >>>> 5A 65 72 6f
then i change the hex to integer
using these integer i convert them to char using chr()
it did the job great, i can see the correct word i want..but it give me an error saying " make sure it has the right format" ( error shown below)
please help...Code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim hexnum As String Dim converttohex As String Dim hextonum As Integer Dim chara As Char hexnum = txtReceivedMessage.Text For i = 1 To Len(hexnum) Step 2 converttohex = Mid(hexnum, i, 2) hextonum = Convert.ToInt32(converttohex, 16) '<<<<< ERROR here chara = Chr(hextonum) TextBox1.Text += chara Next i
i thought it was the for loop problem...since i will go up to 7 while len(hexnum) is 8 so it would loop again but there is nothing after 8th HEX?
so i tried For i = 1 To Len(hexnum)-1 Step 2 ...this time...textbox didnt show anything...+ the same error came up...




Reply With Quote