Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How can ein convert a character or String hex

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1188
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How can ein convert a character or String hex
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How can ein convert a character or String hex - 7/28/2004 2:47:06 AM   
  hai3

 

Posts: 1
Score: 0
Joined: 7/28/2004
From:
Status: offline
I have a problem by converting a character or a String into hex. I need this function to encrypt a variable that contains characters and numbers.
Can anyone help me, please
Thanks
 
 
Post #: 1
 
 Re: How can ein convert a character or String hex - 7/31/2004 9:26:24 PM   
  devguy

 

Posts: 15
Score: 0
Joined: 7/31/2004
From: USA
Status: offline
This should give you an idea...



Option Explicit
Dim sStr
Do
sStr = InputBox("Enter string for hex conversion:")
If Len(sStr) > 0 Then
MsgBox ConvertString(sStr)
End If
Loop While Len(sStr) > 0

Function ConvertString(ByVal psStr)
Dim iChar
Dim iX
Dim sCvt
Dim sHex

sCvt = ""
For iX = 1 To Len(psStr)
iChar = Asc(Mid(psStr, iX, 1))
sHex = Hex(iChar)
If Len(sHex) < 2 Then
sHex = "0" & sHex
End If
sHex = Mid(sHex, 2, 1) & Mid(sHex, 1, 1)
sCvt = sCvt & sHex
Next
ConvertString = sCvt
End Function

(in reply to hai3)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How can ein convert a character or String hex Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts