guruprakash asked this 7 years ago

How to convert ASCII character to hexadecimal in VB.NET?

I am trying to convert ASCII text to equivalent hexadecimal notation.

Example HELLO should return 48454c4c4f.


Vikas 7 years ago
1 like

here is the program

dim msg As String = "Hello"

dim hexstring As String

 

for i = 0 to msg.length -2 step 2

  hexstring = Hex(Asc(msg(i))) +Hex(Asc(msg(i + 1)))

next i

Guest 4 years ago

dim msg As String = "Hello"

dim hexstring As String

 

for i = 0 to msg.length -2 step 2

  hexstring = Hex(Asc(msg(i))) +Hex(Asc(msg(i + 1)))

next i