Tag: 保存

下载文件并自动将其保存到文件夹

我正在尝试创建一个用于从我的网站下载文件的UI。 该站点具有zip文件,需要将这些文件下载到用户输入的目录中。 但是,我无法成功下载该文件,它只是从一个临时文件夹打开。 码: private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) { e.Cancel = true; string filepath = null; filepath = textBox1.Text; WebClient client = new WebClient(); client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); client.DownloadFileAsync(e.Url, filepath); } 完整源代码: http : //en.paidpaste.com/LqEmiQ