我正在尝试创建一个复制文件或文件夹并测量复制时间的函数
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;
}
我试图找到资源管理器的“复制窗口”何时消失,但我没有成功......