hello i am codding a program and I get an error index out of range exception was unhandeled
my code is
[XCODE]
Public Class Form1 Dim OS() As String
Dim UserName() As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OS = My.Computer.Inf
SFullName.Split("")
UserName = My.User.Name.Split("\")
TextBox1.Text = OS(2)
TextBox2.Text = UserName(1)
If OS(2) = "XP" Then TextBox3.Text = "C:\Documents and Settings\" & UserName(1) & "\Application Data\.minecraft\bin\minecraft.jar" Else
TextBox3.Text = "C:\Users\" & UserName(1) & "\AppData\Roaming\.minecraft\bin\minecraft.jar"
End Sub
End Class
[/XCODE]
and it has an error in the line of code
[XCODE]
TextBox1.Text = OS(2)
[/XCODE]
please help
thanks charlie
my code is
[XCODE]
Public Class Form1 Dim OS() As String
Dim UserName() As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OS = My.Computer.Inf
UserName = My.User.Name.Split("\")
TextBox1.Text = OS(2)
TextBox2.Text = UserName(1)
If OS(2) = "XP" Then TextBox3.Text = "C:\Documents and Settings\" & UserName(1) & "\Application Data\.minecraft\bin\minecraft.jar" Else
TextBox3.Text = "C:\Users\" & UserName(1) & "\AppData\Roaming\.minecraft\bin\minecraft.jar"
End Sub
End Class
[/XCODE]
and it has an error in the line of code
[XCODE]
TextBox1.Text = OS(2)
[/XCODE]
please help
thanks charlie