Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Dim sTest as String = "foobar"
Dim cCurrent as Char
cCurrent = sTest.Chars(3)
Ausnahme System.IndexOutOfRangeException wurde im ausgeführten Programm ausgelöst:
Index was outside the bounds of the array.
BtnEncodeClick() - E:\Crypt\MainForm.vb:40,6
OnClick()
OnClick()
OnMouseUp()
WmMouseUp()
WndProc()
WndProc()
WndProc()
OnMessage()
WndProc()
DebuggableCallback()
System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop()
RunMessageLoopInner()
RunMessageLoop()
Run()
OnRun()
DoApplicationModel()
Run()
Main() - 17d14f5c-a337-4978-8281-53493378c1071.vb:81,13
arrIntern(intI) = arrErsatz(intJ)
Dim arrEingabe() As Char = txtEingabe.Text.ToCharArray
Dim arrIntern() As Char = {}
Dim ende As String
Dim arrZeichen() As Char = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}
Dim arrErsatz() As Char = {"N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M"}
Dim intI As Integer
Dim intJ As Integer
Dim chrZeichen As Char
Dim chrZZeichen As Char
For intI = 0 To arrEingabe.Length() - 1
For intJ = 0 To arrZeichen.Length() - 1
chrZZeichen = arrEingabe(intI)
If ([Char].IsLower(chrZZeichen)) Then
chrZeichen = [Char].ToUpper(chrZZeichen)
Else
chrZeichen = chrZZeichen
End If
If (chrZeichen = arrZeichen(intJ)) Then
arrIntern(intI) = arrErsatz(intJ)
End If
Next
Next
ende = arrIntern.ToString()
txtAusgabe.Text = ende
txtEingabe.Text = ""
If (chrZeichen = arrZeichen(intJ)) Then
[b]ReDim Preserve arrIntern(intI)[/b]
arrIntern(intI) = arrErsatz(intJ)
End If
ReDim arrIntern(arrEingabe.Length())
For intI = 0 To arrEingabe.Length() - 1
...
ende = arrIntern.ToString()
@Lookshe:
Ich glaube da liegst du falsch. Der Index der meisten Arrays und Collections beginnt in der .NET-Familie bei 0.
Naja, dann hat MS wenigstens eine sinnvolle Änderung gemacht. Früher war das noch anders.
Dim Eingabe As String = "test"
Dim arrZeichen() As Char = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
Dim arrErsatz() As Char = {"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M"}
Dim Ausgabe As String = ""
For Each C As Char In Eingabe.ToUpper
Ausgabe = Ausgabe & arrErsatz(Array.IndexOf(arrZeichen, C))
Next