Public Function encrypt(s As String, v As Long) As String
Dim total As String
Dim tmp As String
For i = 1 To Len(s)
tmp = Mid(s, i, 1)
tmp = Asc(tmp) + v
tmp = Chr(tmp)
total = total & tmp
Next i
encrypt = total
End Function
Public Function decrypt(s As String, v As Long) As String
Dim total As String
Dim tmp As String
For i = 1 To Len(s)
tmp = Mid(s, i, 1)
tmp = Asc(tmp) - v
tmp = Chr(tmp)
total = total & tmp
Next i
decrypt = total
End Function
Private sub command1_click()
text1.text = encrypt(text1.text,3)
end sub
Private sub command2_click()
text1.text = decrypt(text1.text,3)
end sub
Thank's for reading the articelEncrypt Descrpyt String Simple VB6 .If You want to copy paste your website please tag my link Encrypt Descrpyt String Simple VB6 Intro My Website.
0 comments:
Post a Comment