在C#中更改IP地址
我有一个 c# 程序,需要通过 UDP 连接连接到另一台计算机。为了执行此操作,我需要暂时更改计算机上网卡的 IP 地址,以便它们可以相互通信。我可以很好地做到这一点。然而,当我完成后,我想将我的IP地址恢复到以前的状态;也就是自动获取IP地址。
有人可以告诉我如何将设置更改回以前的设置吗?
谢谢,
菲尔
I have a c# program that needs to connect to another computer via a UDP connection. In order to perform this operation, I need to temporarily change the IP address of my network card on my computer, so they can talk to one another. I can do this just fine. However, when I'm done, I want to restore my IP address back to what it was before; which is to automatically obtain an IP address.
Can someone tell me how to change my settings back to what they were previously?
Thanks,
Phil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要检查此 SwitchNetConfig 项目。
您感兴趣的部分是如何更改IP:
You may want to check this SwitchNetConfig project.
The part that interest you is how to change the IP: