MEASURE COPYING TIME THROUGH WINDOWS EXPLORER C#

F Scott Fitzgerald

Total Post:29

Points:203
Posted by  F Scott Fitzgerald
C# 
C#
 949  View(s)
Ratings:
Rate this:

I am creating a mthod which is measures the copy time for files and folder.

 public static TimeSpan CopyFileExplorer(string filePath, string fileDestination)
    {
 
        string command = @"/select, " + filePath;
        System.Diagnostics.Process.Start("explorer.exe", command);
        SendKeys.Send("^(C)");
        command = @"/select, " + fileDestination;
        System.Diagnostics.Process.Start("explorer.exe",command);
        DateTime startCopy = DateTime.Now;
        SendKeys.Send("^(V)"); 
 
        //need to be catched when explorer finishes the copy
        DateTime endCopy = DateTime.Now;
 
        return endCopy - startCopy;
    }

I have tried to find when the "copy window" of explorer disappears, but I didn't be successful...

  1. Ida B Wells

    Post:30

    Points:210
    Re: Measure copying time through windows explorer C#

    You should try SendKeys.SendWait("");

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!