我如何使用C#更改我的IP [英] HOW can i change my IP using c#

查看:82
本文介绍了我如何使用C#更改我的IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我可以使用C#在Win App中更改我的IP地址吗?

Hello all.

Can i change my IP Address in win app using c#?

thanks.

推荐答案

假定您具有固定IP,并且未由DHCP服务器租用:
1)您可以直接更改注册表项( http://support.microsoft.com/kb/314053 [ ^ ]和 ^ ]或 http://windowsclient.net/blogs /gasem_karimi/archive/2009/12/31/change-ip-address-wmi.aspx [
Supposing you have fixed IP, and not leased by a DHCP server:
1) You can change directly the registry key (http://support.microsoft.com/kb/314053[^] and Read, write and delete from registry with C#[^] or Programmatically Changing IP address, Domain Name Server and Gateways[^])
2) Using WMI (http://windowsclient.net/blogs/gasem_karimi/archive/2009/12/31/change-ip-address-wmi.aspx[^])

You need to restart the interface or the connection to make changes effective.


在此处查看: SwitchNetConfig-便携式计算机用户,可以在以下位置快速切换网络和代理配置不同的地方 [ ^ ]
Have a look here: How can you change Network settings (IP Address, DNS, WINS, Host Name) with code in C#[^]

Following article be of interest: SwitchNetConfig - Laptop users, quickly switch network and proxy configuration in different places[^]


这篇关于我如何使用C#更改我的IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆