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

	If File.Exists(singleFile.FullName) Then
		singleFile.MoveTo("/newpath/" & singleFile.Name)
	End If
Loops through xml files within a directory. A method could then be called passing the filename to it.

Updated: Sunday 10th October 2010, 03:01am

There are 0 comments

Leave a comment of your own

Comments are currently closed.