public async Task DownloadGame(string game, string downloadpath)
{
Process process = new Process();
process.StartInfo.FileName = rclonepath;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.Arguments = "copy -P " + "test1:" + game + " " + downloadpath + game;
process.EnableRaisingEvents = true;
process.Start();
process.BeginOutputReadLine();
// Wait for the process to exit
await Task.Run(() => process.WaitForExit());
}
private void guna2Button1_Click(object sender, EventArgs e)
{
string game = "mygame";
string downloadpath = "C:\\temp\\";
DownloadGame(game, downloadpath);
}
}
}
public async Task DownloadGame(string game, string downloadpath)
{
Process process = new Process();
process.StartInfo.FileName = rclonepath;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.Arguments = "copy -P " + "test1:" + game + " " + downloadpath + game;
process.EnableRaisingEvents = true;
process.Start();
process.BeginOutputReadLine();
// Wait for the process to exit
await Task.Run(() => process.WaitForExit());
}
private void guna2Button1_Click(object sender, EventArgs e)
{
string game = "mygame";
string downloadpath = "C:\\temp\\";
DownloadGame(game, downloadpath);
}
}
}