string url = "http://www.microsoft.com";
string outputfile = "temp.html";
using (WebClient client = new WebClient())
{
//could also do: byte[] bytes = client.DownloadData(url);
try
{
client.DownloadFile(url, outputfile);
}
catch (WebException ex)
{
Console.WriteLine(ex.Message);
}
}