How to check which files have been downloaded in some particular folder in C#.net?

197 Views Asked by At

How to check which files have been downloaded in some particular folder in C#.net ? The files are kept by other application and not by the current .Net application.

1

There are 1 best solutions below

1
On

region File Info

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

// How to check if my files have been downloaded or still in progress of downloading.