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
NextLoops through xml files within a directory. A method could then be called passing the filename to it.
Updated: Sunday 10th October 2010, 21:45am
There are 0 comments
Comments are currently closed.