private void SetProxyToBrowser(WebBrowser iWB)
{
try
{
string ProxyEmail = "" ;
string ProxyPass = "" ;
string ProxyUID = "" ;
string ProxyUPass = "" ;
string ProxyIp = "" ;
int ProxyPort = 0;
ProxyIp = "Proxy IP";
ProxyPort = Proxy Port;
ProxyUID = "Proxy User ID"; // IF You Have
ProxyUPass = "Proxy User Password"; // IF You Have
ProxyEmail = "Proxy Email ID";
ProxyPass = "Proxy Email Password";
Application.DoEvents();
HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest .Create(SignInAddress);
WebProxy myProxy = new WebProxy(ProxyIp, ProxyPort);
if (ProxyUID.Trim() != "" && ProxyUPass.Trim() != "")
myProxy.Credentials = new NetworkCredential (ProxyUID, ProxyUPass);
myRequest.Proxy = myProxy;
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
iWB.DocumentStream = myResponse.GetResponseStream();
}
catch
{
//Code...
}
}