in this code
DirectoryInfo d = new DirectoryInfo(@"path");
FileInfo[] infos = d.GetFiles("*");
int i = 0;
foreach (FileInfo fi in d.GetFiles())
{
i = 0;
i = i + 1;
System.IO.File.Move(fi.FullName, Path.Combine(fi.Directory.ToString(), Convert.ToString(i)) + fi.Extension);
}
i have this exception(IOException unhandled)(The process cannot access the file because it is being used by another process)
in this line of code
System.IO.File.Move(fi.FullName, Path.Combine(fi.Directory.ToString(), Convert.ToString(i)) + fi.Extension);


Sign In
Create Account

Back to top









