vbnet Loop through files within a directory

Dim Directory As New IO.DirectoryInfo(My.Settings.DataPath)
Dim allFiles As IO.FileInfo() = Directory.GetFiles("*.xml")
Dim singleFile As IO.FileInfo
For Each singleFile In allFiles
Console.WriteLine(singleFile.FullName)
If File.Exists(singleFile.FullName) Then
singleFile.Delete()
singleFile.MoveTo("/newpath/" & singleFile.Name)
End If
Next

Loops through xml files within a directory. A method could then be called passing the filename to it.

Please use all code snippets with extreme caution.
Although most have been tested working successfully, ensure you make backups before using them.
Slickhouse takes no responsibility for any loss or damage as a result of using these Snippets.