VB Code:
Private Function Encrypt(strInput As String) As String Dim letters As String Dim encArr() As Variant Dim daChar As String Dim strOutput As String letters = "abcdefghijklmnopqrstuvwxyz/.1234567890~_:" encArr = Array("%61", "%62", "c", "%64", "e", "%66", "%67", "%68", "%69", _ "%6a", "%6b", "%6c", "m", "n", "o", "%70", "%71", "%72", "%73", "t", "%75", _ "%76", "w", "%78", "%79", "%7a", "/", ".", "1", "2", "3", "4", "5", "6", "7", _ "8", "9", "0", "~", "_", "!", ":") For i = 1 To Len(strInput) daChar = Mid(strInput, i, 1) For e = 1 To Len(letters) If daChar = Mid(letters, e, 1) Then strOutput = strOutput & encArr(e - 1) Exit For End If Next Next Encrypt = strOutput End Function Private Sub cmdEncrypt_Click() txtEncryptedURL.Text = Encrypt(txtURL.Text) End Sub





Reply With Quote