更新时间:2022-04-20 22:06:30
您可以使用 SaveFileDialog 类。示例:
var dialog = new SaveFileDialog();
dialog.Filter = "Archive (*.rar)|*.rar";
var result = dialog.ShowDialog(); //shows save file dialog
if(result == DialogResult.OK)
{
Console.WriteLine ("writing to: " + dialog.FileName); //prints the file to save
var wClient = new WebClient();
wClient.DownloadFile("WebLinkHere", dialog.FileName);
}
将显示下一个对话框,如果您搜索下一个文件夹
will show next dialog and if you search for next folder
应用程序将打印:
writing to: C:\Temp\archiveName.rar