There are two ways to do so :
Solution 1 :
string url = "http://google.com";
string strResult = "";
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
strResult = sr.ReadToEnd();
sr.Close();
}
Response.Write(strResult);
Solution 2 :
System.Net.WebClient webClient = new System.Net.WebClient();
webClient.DownloadFile("http://www.dotnetspider.com/index.aspx","C:\\spider.html");
Check
this link for full code[
^]
Hope this helps.
All the best.