Private Sub CeasarEncrypt(ByVal mystring As String, ByRef encryptstring As String) Dim mytext As String Dim oldchr As String Dim newchr As String Dim l As Integer dim k as integer Dim pos As Integer Dim twotext(1) As String Dim v As Byte Dim iter As Integer mytext = mystring 'CHANGE CHAQUE LETTRE SELON ch[i] = ch[i] + k k = 1 For iter = 0 To mytext.Length - 1 oldchr = mytext.Substring(iter, 1) pos = iter If pos > 0 Then twotext(0) = mytext.Substring(0, pos) Else twotext(0) = "" End If l = mytext.Length - pos - 1 twotext(1) = mytext.Substring(pos + 1, l) v Asc(oldchr) + k newchr Chr(v) mytext = twotext(0) & newchr & twotext(1) Next encryptstring = mytext End Sub
CeasarEncrypt("AABB", Me.TextBox1.Text)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionChr("123") ' renvoit '{' Asc("{") ' renvoit '123'