下载文件并“另存为”
我需要编写一个过程来在我的 vb.net Web 应用程序中本地下载 html 文件。我当前正在使用 webClient.DownloadFile
:
Dim myWebClient As New System.Net.WebClient
myWebClient.DownloadFile("http://archive.ncsa.illinois.edu/primer.html", _
"C:\test.html")
是否有一种内置方法可以使用“另存为”窗口来执行此操作,以便用户可以选择他们想要保存文件的位置到?或者我需要自己写?
I need to write a process to download an html file locally in my vb.net web app. I am currently using webClient.DownloadFile
:
Dim myWebClient As New System.Net.WebClient
myWebClient.DownloadFile("http://archive.ncsa.illinois.edu/primer.html", _
"C:\test.html")
Is there a built-in way to do this with a "save as" window instead, so that the user can select the location they would like the file to be saved to? Or would I need to write my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以使用
You can use
虽然我意识到这不是您问题的答案(请参阅托马斯答案的评论),但有时保持简单是一个好方法
Whilst I realise this isn't an answer to your question (see comment on Thomas' answer), sometimes keeping it simple is a good way to go
尝试下面的代码
Try the below code