Converting to Hex URGENT

  • 19 years ago

    From Vb i want to Convert   the string "USA001"  into Hexadeximal form.


    Pls gave me idea


    thanks


    Dhinakaran

  • 19 years ago

    Strings cannot be stored in hexadecimal form! Hexadecimal can only store numbers. If you wanted to store a string in Hex, you'd have to convert all the characters to their ascii codes first

  • 19 years ago

    how to get the ascii  value of a character

  • 19 years ago

    how to get the ascii  value of a character

  • 19 years ago

    here is how to convert a string to hex using ascii conversion first:


    Hex(Asc(sString))

  • 19 years ago

    Note that Asc("thestring") will only return the character code for the first letter, ie t .... you would need to loop through the whole lot to get all their ascii code. Storing a string in hex format is very inefficient...!

  • 19 years ago

    Err yeah sorry I forgot to mention that.  It was late last night  =]   If you are looking to just do an encryption, my suggestion would be to keep the characters of the string each in single ascii characters.  Just use a complicated equation to calculate the method.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Weeks of coding can save you hours of planning.”