How to download PDF from website and store in %appdata% with Visual Basic .NET

James S picture James S · Nov 24, 2012 · Viewed 7.7k times · Source

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.

Answer

Matt Valley picture Matt Valley · Nov 24, 2012

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.