Fejl i kode - Hjælp
hej.Dette har virket før, men ved ikke hvad der er galt nu, (Har lavet om på rækkefølger af erklæringerne), men her kommer koden:
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fil As New IO.DirectoryInfo("C:\test2\")
Dim fswf As IO.FileInfo() = fil.GetFiles("*.swf")
Dim inf As IO.FileInfo
Dim temp As String
Dim LineOfText As String
Dim i As Integer
Dim FILE_Name123 As String = "C:\test2\" & Label2.Text & ".game.php"
Dim TextLine As String
For Each inf In fswf
temp = Len(inf.Name123)
temp = temp - 4
temp = Microsoft.VisualBasic.Left(inf.Name123, temp)
Label2.Text = (temp)
'MsgBox(FILE_Name123)
If System.IO.File.Exists(FILE_Name123) = True Then
Dim objReader As New System.IO.StreamReader(FILE_Name123)
Do While objReader.Peek() <> -1
TextLine = TextLine & objReader.ReadLine() & ","
Loop
Else
TextBox3.Text = TextBox3.Text & Name123
End If
Dim aryTextFile() As String
LineOfText = TextBox1.Text
aryTextFile = LineOfText.Split(",")
For i = 0 To UBound(aryTextFile)
MsgBox(aryTextFile(i))
Next i
Dim Name123 As String
Dim Width123 As String
Dim Height123 As String
Name123 = aryTextFile(43)
Name123 = Len(Name123)
Name123 = Name123 - 10
Name123 = Microsoft.VisualBasic.Mid(aryTextFile(43), 9, Name123)
'MsgBox(Name123)
Width123 = aryTextFile(53)
Width123 = Len(Width123)
Width123 = Width123 - 15
Width123 = Microsoft.VisualBasic.Mid(aryTextFile(53), 14, Width123)
'MsgBox(Width123)
Height123 = aryTextFile(56)
Height123 = Len(Height123)
Height123 = Height123 - 16
Height123 = Microsoft.VisualBasic.Mid(aryTextFile(56), 15, Height123)
'MsgBox(Height123)
TextBox1.Text = TextLine
TextBox2.Text = TextBox2.Text & "INSERT INTO ava_games (Name123, description, url, catergory_id, published, image, Width123, Height123, filetype) VALUES('" & Name123 & "', '', 'http://www.arcadeskillz.com/games/" & Label2.Text & ".swf', '2', '1', 'http://www.arcadeskillz.com/games/" & Label2.Text & "1.gif', '" & Width123 & "', '" & Height123 & "', '1');" & vbNewLine
Next inf
End Sub