J'essaye d'émuler le cryptage César Cipher. Le problème est que chaque fois que j'ai entré "wxyz"
(décalé de 3
) la sortie est "z {|}". Mais la sortie attendue devrait être "zabc".VB - Emulation César Cipher
Quelqu'un sait quoi ajouter?
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim plaintext As String = TextBox1.Text
Dim charArray() As Char = plaintext.ToCharArray
Dim shift = TextBox2.Text
Dim character As String
Dim temp As String
TextBox3.Text = ""
If shift <> "" And IsNumeric(shift) Then
If plaintext = "" Then
MsgBox("Please input some plain text")
Exit Sub
End If
If shift > 26 Then
MsgBox("Maximum shifts reached. Limit is 26!!")
Exit Sub
End If
For loope = 0 To charArray.Length - 1 Step +1
temp = charArray(loope)
character = Chr(Asc(temp) + shift)
TextBox3.Text += character
Next
Exit Sub
Else
MsgBox("Input numbers only!!")
End If
End Sub
Quel beau travail :-) – muffi
En fait, c'est notre projet de mi-parcours :-) –