问题
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:
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.
来源:https://stackoverflow.com/questions/12028010/how-to-use-custom-ip-address-to-browse-a-web-page-c-net