Namespace:
using System.Net;
Code:
try
{
String Result, URL;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
ICredentials credentials = new NetworkCredential("username", "Password", "Domain");
IWebProxy webProxy = new WebProxy("proxy URL", 8080);
webProxy.Credentials = credentials;
request.Proxy = webProxy;
WebResponse myResponse = request.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
Result = sr.ReadToEnd();
sr.Close();
myResponse.Close();
}
catch { }
using System.Net;
Code:
try
{
String Result, URL;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
ICredentials credentials = new NetworkCredential("username", "Password", "Domain");
IWebProxy webProxy = new WebProxy("proxy URL", 8080);
webProxy.Credentials = credentials;
request.Proxy = webProxy;
WebResponse myResponse = request.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
Result = sr.ReadToEnd();
sr.Close();
myResponse.Close();
}
catch { }
No comments:
Post a Comment