using System.Net;
using System.IO;
string url = "http://www.google.com";
WebRequest request = WebRequest.Create(url);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream, System.Text.Encoding.Default);
Response.Write(reader.ReadToEnd());
reader.Close();
dataStream.Close();
using System.IO;
string url = "http://www.google.com";
WebRequest request = WebRequest.Create(url);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream, System.Text.Encoding.Default);
Response.Write(reader.ReadToEnd());
reader.Close();
dataStream.Close();