guruprakash asked this 3 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 3 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 8 months 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