static async Task Main(string[] args) { //You can use the command 'fsutil file createnew c:\Test1\file1.txt 131457280' to create a file with 125MB (Needs to be executed under administrator privileges). //Or this script to create multiple files: //For ($i=0; $i -lt 200; $i++) { cmd.exe / c("C:\WINDOWS\system32\fsutil file createnew c:\Test1\file" + $i + ".txt 1457280") } var source = @"C:\Test1\"; var destination = @"C:\Test2\"; await FileTransferManager.CopyWithProgressAsync(source, destination, Progress, false, true, 500); }
public IObservable <ITransferProgress> Transfer(params string[] args) { string source = args[0]; string destination = args[1]; async void Init() { await FileTransferManager.CopyWithProgressAsync( source, destination, transferProgress.OnNext, true) .ContinueWith(a => { }); } Init(); return(transferProgress.Cast <ITransferProgress>()); }
public static Task CopyFile(string source, string target, Action <TransferProgress> progress, CancellationToken cancellationToken = default(CancellationToken)) { return(FileTransferManager.CopyWithProgressAsync(source, target, progress, false, false, cancellationToken)); }