Monday, May 27, 2013

Set Proxy To Webbrowser in c#

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...
            }

        }

1 comment:

  1. Ankur Bhargav'S C Bolg >>>>> Download Now

    >>>>> Download Full

    Ankur Bhargav'S C Bolg >>>>> Download LINK

    >>>>> Download Now

    Ankur Bhargav'S C Bolg >>>>> Download Full

    >>>>> Download LINK bR

    ReplyDelete