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

我是研究僧i 提交于 2019-12-02 22:29:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!