Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on encryption
Message
From
11/05/2006 18:18:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/05/2006 17:24:08
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01121152
Message ID:
01121173
Views:
11
>I built this small function that does it but I was wondering if there would be something builtin the .NET Framework that would accomplish the same:
>
>
>    Private Function StringToHexadecimal(ByVal tcString As String) As String
>        Dim lcString As String = ""
>        Dim lnCounter As Integer = 0
>        For lnCounter = 1 To tcString.Length
>            lcString = lcString + Hex(Asc(Mid(tcString, lnCounter, 1)))
>        Next
>        Return lcString
>    End Function
>
Hex is a VB function I think. With .Net there should be several ways. ie:
     Dim lcString As String = ""
     Dim lnCounter As Integer = 0
   dim bytes as Byte() = Encoding.ASCII.GetBytes( tcString )
      For lnCounter = 1 To tcString.Length
          lcString = lcString + String.Format( "{0:X}",bytes(lnCounter) )
      Next
      Return lcString
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform