how to use custom ip address to browse a web page c#/.net

2.8k views Asked by At

i am trying to browse web page using custom(user provided) ip address but it's not working. webBrowser1 loads web page successfully but it's not using custom ip address, it loads page with real ip address.

please tell me how to make this work successfully.

this is my code:

private void Form1_Load(object sender, EventArgs e)
    {
        IPAddress addr1 = IPAddress.Parse("192.168.1.100");
        webBrowser1.ScriptErrorsSuppressed = true;
        webBrowser1.Navigate("www.whatismyip.com");
    }
1

There are 1 answers

6
walther On

You can't change your IP like this. Your code obviously doesn't work, because you've just created a variable of type IPAddress and assigned some value to it. If you want a different IP address that you currently have assigned from your internet provider, you need to use a Proxy or TOR if you can't achieve a change of your IP by restarting your modem. However, it won't obviously allow you to use whatever IP you'd like.