01-05-2012، 05:02 PM
با سور زیر میتونید رشته های یک لینک یا همان Url رو اینکود کنید چیز بدرد بخوریه
سورس کد :
سورس کد :
کد:
Private Sub Form_Load()
MsgBox Encode("www.parsicoders.com")
End Sub
Function Encode(sEncode As String) As String
Dim i As Integer
Dim sCharacters As String
sCharacters = Replace(sEncode, "%", Chr(1))
sCharacters = Replace(sCharacters, "+", Chr(2))
For i = 0 To 255
Select Case i
Case 37, 43, 48 To 57, 65 To 90, 97 To 122
'Normal Characters
Case 1
sCharacters = Replace(sCharacters, Chr(i), "%25")
Case 2
sCharacters = Replace(sCharacters, Chr(i), "%2B")
Case 32
sCharacters = Replace(sCharacters, Chr(i), "+")
Case 3 To 15
sCharacters = Replace(sCharacters, Chr(i), "%0" & Hex(i))
Case 58
sCharacters = Replace(sCharacters, Chr(i), "%3A")
Case Else
sCharacters = Replace(sCharacters, Chr(i), "%" & Format(Hex(i), "00"))
End Select
Next
Encode = sCharacters
End Function