如何从网站下载PDF并使用Visual Basic .NET存储在%appdata%中 [英] How to download PDF from website and store in %appdata% with Visual Basic .NET

查看:189
本文介绍了如何从网站下载PDF并使用Visual Basic .NET存储在%appdata%中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PDF文件托管在一个网站上。我想要我的VB.NET程序检索文件/下载它,并将其存储在%appdata%中的某个位置。这可以在一个文件夹中,如%appdata%/ my_program ,如果你愿意的话。我如何在VB.NET程序中实现这一点?
谢谢。

解决方案

您可以使用 WebClient.DownloadFile(Url,LocalPath) code>用于下载PDF文件并保存在PC上的本地路径中。该课程位于 System.Net Assembly 中。


I have a PDF file hosted on a website. I would like my VB.NET program to retrieve the file/download it and store it somewhere in %appdata%. This could be in a folder of it's own like %appdata%/my_program if you want. How do I achieve this in my VB.NET program? Thanks.

解决方案

You can use WebClient.DownloadFile(Url,LocalPath) for downloading your PDF file and saving in a local path on your PC. The class is in System.Net Assembly.

这篇关于如何从网站下载PDF并使用Visual Basic .NET存储在%appdata%中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆