如何检查哪些文件已下载到C#.net的某个特定文件夹中?

时间:2018-11-19 18:58:39

标签: c# .net file system.io.file

如何检查C#.net中某个特定文件夹中已下载了哪些文件?这些文件由其他应用程序保存,而不由当前的.Net应用程序保存。

1 个答案:

答案 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);
        }

//如何检查我的文件是否已经下载或仍在下载中。