DirectoryInfo d = new DirectoryInfo(@"E:\Images\"); FileInfo[] infos = d.GetFiles("*"); int i = 0; foreach (FileInfo f in infos) { i = i + 1; File.Move(f.FullName, Path.Combine(f.Directory.ToString(), Convert.ToString(i)) + f.Extension); }
DirectoryInfo di = new DirectoryInfo("Folder_of_interest"); foreach (FileInfo fi in di.GetFiles()) { fi.MoveTo("new_file_name"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)