Kann mir jemand kurz helfen, was ich hier falsch mache?
Eigentlich möchte ich ein Text verschlüsseln.
Bekomme eine Fehlermeldung
Structure 'Char' cannot be indexed because it has no default property.
Eigentlich möchte ich ein Text verschlüsseln.
Bekomme eine Fehlermeldung
Structure 'Char' cannot be indexed because it has no default property.
Visual Basic-Quellcode
- Public Function EncrypText(ByVal strText As String) As String
- Dim strResult As String = ""
- For Each Chr As Char In strText
- Dim iAsc As Integer = Asc(Chr)
- If iAsc >= 65 AndAlso iAsc <= 90 Then
- iAsc += 13
- If iAsc > 90 Then iAsc = iAsc - 26
- ElseIf iAsc >= 97 AndAlso iAsc <= 122 Then
- iAsc += 13
- If iAsc > 122 Then iAsc = iAsc - 26
- End If
- strResult = strResult + Chr(iAsc)
- Next
- Return strResult
- End Function