Manipulate Files using wildcards
Heres how you can do stuff to files with a certain file extension.
Copy N Paste Code underneith showcase code
ShowCase
VB.NET Code:
For Each foundFile As String In IO.Directory.GetFiles("DIRECTORY", "WILDCARD")
Dim FilenameWextension As String = GetFileNameFromPath(foundFile)
'DO WHAT YOU WANT HERE
Next
Public Function GetFileNameFromPath(ByVal Path As String) As String
Try
Return Path.Substring(Path.LastIndexOf("\") + 1)
Catch ex As Exception
Return Path
End Try
End Function
C'n'P
Code:
For Each foundFile As String In IO.Directory.GetFiles("DIRECTORY", "WILDCARD")
Dim FilenameWextension As String = GetFileNameFromPath(foundFile)
'DO WHAT YOU WANT HERE
Next
Public Function GetFileNameFromPath(ByVal Path As String) As String
Try
Return Path.Substring(Path.LastIndexOf("\") + 1)
Catch ex As Exception
Return Path
End Try
End Function