Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. using System.Net;
  2.  
  3. using (WebClient client = new WebClient ()) // WebClient class inherits IDisposable
  4. {
  5.     client.DownloadFile("http://yoursite.com/page.html", @"C:\localfile.html");
  6.  
  7.     // Or you can get the file content without saving it
  8.     string htmlCode = client.DownloadString("http://yoursite.com/page.html");
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement