Dim NewPath As String
Dim fileList As System.Collections.ObjectModel.ReadOnlyCollection(Of String)
Dim Lung As Integer
Dim NomeFile As String
NomeFile = ""
My.Computer.FileSystem.CurrentDirectory = txtDirectory.Text
NewPath = My.Computer.FileSystem.CurrentDirectory
fileList = My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory)
For Each foundFile As String In fileList
Lung = Len(foundFile) - 1
Do While foundFile.Chars(Lung) <> "\"
Lung -= Lung - 1
Loop
NomeFile = Mid(foundFile, Lung)
lstFilePick.Items.Add(foundFile)
Next
|