1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using a proxy with a webBrowser in C# IE

Discussion in 'C, C++, C#' started by ivarga, May 20, 2016.

  1. ivarga

    ivarga Junior Member

    Joined:
    Mar 13, 2014
    Messages:
    104
    Likes Received:
    42
    Hello ther BHW members!

    I am working on a small web browser in C# .NET
    And I was wondering.. Could I use two text boxes 1 for the proxy ip and 1 for the port to hook the browser up with a proxy?

    If that is possible.. Could someone give me an example on how it would look like? Would be very helpful!
     
  2. hoanglink2

    hoanglink2 Newbie

    Joined:
    Mar 8, 2015
    Messages:
    14
    Likes Received:
    2
    hmm, don't really get what you mean. are you using web browser control in C# .net?
    but :
    textbox? textbox isn't not problem here. just create two textbox, and get those value and put in it
    WebProxy() params
    like that:

    string ip = textbox1.getText();
    string port = textbox2. getText();
    string proxy = ip + ":" + port;
    WebProxy myProxy = new WebProxy(proxy );


    then use that web proxy for whatever you want, like:

    HttpWebRequest myRequest =(HttpWebRequest)HttpWebRequest.Create("http://www.stackoverflow.com");
    myRequest.Proxy = myProxy;
    HttpWebResponse myResponse =(HttpWebResponse)myRequest.GetResponse();
     
  3. ivarga

    ivarga Junior Member

    Joined:
    Mar 13, 2014
    Messages:
    104
    Likes Received:
    42
    Would you mind contacting me through Pm? I would appriciate that so much :D
     
  4. hoanglink2

    hoanglink2 Newbie

    Joined:
    Mar 8, 2015
    Messages:
    14
    Likes Received:
    2
    sure, pm me
     
  5. ivarga

    ivarga Junior Member

    Joined:
    Mar 13, 2014
    Messages:
    104
    Likes Received:
    42
    I cant find the PM button, thats why I asked you :p
     
  6. hoanglink2

    hoanglink2 Newbie

    Joined:
    Mar 8, 2015
    Messages:
    14
    Likes Received:
    2
    just pm