//include this using System.IO; //set directory to scan var dirInfo = new DirectoryInfo(@"C:\FolderName"); //checking if folder exists if (dirInfo.Exists) { //*.* = get all file name FileInfo[] files = dirInfo.GetFiles("*.*", SearchOption.TopDirectoryOnly); foreach (FileInfo file in files) { //example to list the file name using messagebox MessageBox.Show(file.ToString()); } }Additional Reading at :
No comments:
Post a Comment