Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HEX to ASCII 1

Status
Not open for further replies.

guitardave78

Programmer
Joined
Sep 5, 2001
Messages
1,294
Location
GB
Is it possible to convert a hex string to ascii. There is a website that does exactly this (
The hex i have is 4e6574776f726b7320352d204f6e6c696e652073686f7070696e6720616e64207365637572697479

which converts to
Networks 5- Online shopping and security

Any ideas?

}...the bane of my life!
 
got it

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = HexToStringW("4e6574776f726b7320352d204f6e6c696e652073686f7070696e6720616e64207365637572697479")

    End Sub

    Function HexToStringW(ByVal strhex As String) As String
        Dim b As Byte
        Dim s As String = ""
        For inttemp As Integer = 0 To strhex.Length - 2 Step 2
            b = System.Convert.ToByte(strhex.Substring(inttemp, 2), 16)
            s &= Chr(b)
        Next
        Return s
    End Function


Christiaan Baes
Belgium

"My new site" - Me
 
Nice one.
I did figure it out
My version was about the same, but less well presented.
So not being a proud man I have stuck to yours !!!

}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top