如何检查C#.net中某个特定文件夹中已下载了哪些文件?这些文件由其他应用程序保存,而不由当前的.Net应用程序保存。
答案 0 :(得分:0)
System.IO.DriveInfo di = new System.IO.DriveInfo(@"C:\Users\abc\Desktop\FileDownload");
Console.WriteLine(di.TotalFreeSpace);
Console.WriteLine(di.VolumeLabel);
// Get the root directory and print out some information about it.
System.IO.DirectoryInfo dirInfo = di.RootDirectory;
Console.WriteLine(dirInfo.Attributes.ToString());
// Get the files in the directory and print out some information about them.
System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.*");
foreach (System.IO.FileInfo fi in fileNames)
{
Console.WriteLine("{0}: {1}: {2}", fi.Name, fi.LastAccessTime, fi.Length);
}
//如何检查我的文件是否已经下载或仍在下载中。