Download a web page using c#

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 3111
static void Main(string[] args)
{
string yourUrl = "http://www.dotnetfunda.com/";
string yourOutpuFile = "temp.html";

using (WebClient client = new WebClient())
{
client.DownloadFile(yourUrl, yourOutpuFile);
}
Console.WriteLine("Page Downloaded...");
Console.Read();
}


Result

Downloads the web page to your specified file path.

Comments or Responses

Login to post response