Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Try
- Dim di As New DirectoryInfo(Application.StartupPath & "\Characters\")
- ' Get a reference to each file in that directory.
- Dim fiArr As FileInfo() = di.GetFiles()
- ' Display the names of the files.
- Dim fri As FileInfo
- For Each fri In fiArr
- If fri.Extension = ".png" Then
- TotalCharactersFound += 1
- Dim s As String
- s = fri.Name
- ListBox1.Items.Add(s.Substring(0, s.Length - 4))
- End If
- Next fri
- Label1.Text = "Total Characters Found: " & TotalCharactersFound
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement