简体   繁体   English

如何自动更改IP地址C#

[英]how to automatically change ip address c#

I have an application that open Url evrey 10 secondsusing Process. 我有一个使用Process打开Url evrey 10秒的应用程序。 I want to change my ip address each browser opening. 我想在每次打开浏览器时更改我的IP地址。 How can i change my ip automatically evrey 10 seconds? 我如何在10秒内自动更改IP?

You can change a static IP in your LAN with netsh. 您可以使用netsh在LAN中更改静态IP。 But i don't think that is what you want. 但是我不认为那是你想要的。 You can of course not programatically change your IP assigned by you provider. 当然,您不能以编程方式更改提供商所分配的IP。

Why do you want to do this? 为什么要这样做? The optimist in me hopes you're trying to load test an application , but it sounds like you're trying to spoof something. 我内心的乐观主义者希望您正在尝试对应用程序进行负载测试,但这听起来像是您在试图欺骗某些东西。 In short - you can't do this. 简而言之-您不能这样做。

You have to load a proxy list for your program to use (NEVER HARD-CODE PROXIES). 您必须加载要使用的程序的代理列表(从不使用硬编码的代理)。 Tell your program to select one out a text file. 告诉您的程序从文本文件中选择一个。 Your going to want to make sure to catch any exceptions in case you load a bad proxy, that way you can tell it to use the next one. 您可能要确保在加载错误的代理的情况下捕获任何异常,这样您就可以告诉它使用下一个代理。 I will tell you free proxies are bad for security, and reliability. 我会告诉您免费代理对安全性和可靠性不利。 *Hint HttpWebRequest.Proxy Good luck! *提示HttpWebRequest.Proxy祝您好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM