Moin moin
ich bin grade dabei ein Verschlüsselungsprogramm zu schreiben und hab dabei ein Probleme, bei denen ihr mir vielleicht behilflich sein könntet.
Es funktioniert soweit aber es übernimmt die groß und klein schreibung nicht. Wie kann ich das hin bekommen?
Private Sub cmdStarten_Click()
Dim text As String
Dim key As String
text = txtEingabe.text
key = txtSchluesselworteingabe.text
Dim i As Integer
Dim j As Integer
Dim z As Integer
Dim c As Integer
Dim vtext As String
If optVerschluesseln = True Then
j = -1
text = UCase(text)
key = UCase(key)
For i = 1 To Len(text)
j = (j + 1) Mod Len(key)
If Mid((text), i, 1) = " " Then
vtext = vtext & " "
Else
z = Asc(Mid(text, i, 1)) - 64
c = (z + Asc(Mid(key, j + 1, 1)) - 65) Mod 26
If c = 0 Then c = 26
vtext = vtext & Chr(c + 64)
End If
Next i
txtAusgabe = vtext
End If
If optVerschluesseln = False Then
msgbox1
End If
End Sub
Private Sub cmdEntschluesseln_Click()
Dim text As String
Dim key As String
Dim vtext As String
vtext = txtEingabe.text
key = txtSchluesselworteingabe.text
Dim i As Integer
Dim j As Integer
Dim z As Integer
Dim c As Integer
If optEntschluesseln = True Then
j = -1
vtext = UCase(vtext)
key = UCase(key)
For i = 1 To Len(vtext)
j = (j + 1) Mod Len(key)
If Mid((vtext), i, 1) = " " Then
text = text & " "
Else
z = Asc(Mid(vtext, i, 1)) - 64
c = (z - Asc(Mid(key, j + 1, 1)) - 65) Mod 26
text = text & Chr(c + 90)
End If
Next i
txtAusgabe = text
End If
If optEntschluesseln = False Then
msgbox2
End If
End Sub
Private Sub cmBeenden_Click()
Unload Me
End Sub
Sub msgbox1()
Dim strText As String
strText = ("Bitte Verschlüsseln auswählen!")
MsgBox strText
End Sub
Sub msgbox2()
Dim strText As String
strText = ("Bitte Entschlüsseln auswählen!")
MsgBox strText
End Sub
Sub msgbox3()
Dim strText As String
strText = ("Bitte Schlüsselwort eingeben")
MsgBox strText
End Sub
Sub msgbox4()
Dim strText As String
strText = ("Bitte Schlüsselwort eingeben")
MsgBox strText
End Sub
Private Sub ScrollBar1_Change()
txtEingabe = ScrollBar1.Value
End Sub
|