if (Directory.Exists(@"E:\Gan")) { DirectoryInfo dir=new DirectoryInfo(@"E:\Gan"); FileInfo[] files = dir.GetFiles(); dir.Refresh(); }