更改无线网络适配器无线模式属性
我的学校使用 802.11a,但我在家使用 802.11b。 这意味着每次我从家到学校或其他方式时,我都必须转到设备管理器 ->网络适配器->英特尔(R) WiFi Link 5100 AGN ->属性->高级->无线模式->更改值。
我想制作一个小型 C# 程序来为我完成此任务,但我不知道从哪里开始。
有人能指出我正确的方向吗,我不知道从哪里开始。
我已经从 MSDN 收到了答案 - 但我还没有测试过。 http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/3a8a096d-b0e8-488c-930f-12735e5f7b4b
解决方案 经过一番研究后,我找到了解决方案。 首先,我使用进程监视器来找出哪些注册表值被更改,当我手动更改了无线模式。
现在更改该值包含 2 个步骤。 无线模式的名称映射到一个数字。然后,这些数字将在不同的注册表项中映射到无线模式编号。 因此,我首先根据名称找到数字,然后在不同的注册表项中设置该值。
之后必须重置网络适配器,我使用 WMI 来完成此操作。
我不确定它是否适用于所有 Windows 操作系统,并且我不确定它是否适用于所有网络适配器。无论如何,这就是我所做的。
My school uses 802.11a, but at home I use 802.11b.
This means every time I go from home to school or the other way I have to go to device manager -> Network adapters -> Intel(R) WiFi Link 5100 AGN -> properties -> advanced -> wireless mode -> change the value.
I would like to make a small c# program that does this for me, but I don't know where to start.
Can someone point me in the right direction, I have no idea on where to get started.
I have received an answer from MSDN - but I have not tested it yet.
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/3a8a096d-b0e8-488c-930f-12735e5f7b4b
SOLUTION
After working with this a bit, I found a solution.
First i used Process monitor to figure out which registry values were changed, when I changed the wireless mode manually.
Now changing the value contains 2 steps.
The name for the wireless modes are mapped to a number. The numbers are then mapped in a different registry key to a wireless mode number.
So first I found the number based on the name, and then I set the value in a different registry key.
After that the Network adapter has to be reset, which I used WMI to do.
I got help in This thread on MSDN.
I am not sure, if it works across all windows OS, and I am not sure if it works across all network adapters. Anyways, this is what I did.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您想深入了解 System.Management 命名空间来搞乱设备 http:// msdn.microsoft.com/en-us/library/system.management.aspx
you want to dig into System.Management namespace to mess with devices http://msdn.microsoft.com/en-us/library/system.management.aspx
解决方案 经过一番研究后,我找到了一个解决方案。首先,当我手动更改无线模式时,我使用进程监视器来找出更改了哪些注册表值。
现在更改该值包含 2 个步骤。无线模式的名称映射到一个数字。然后,这些数字将在不同的注册表项中映射到无线模式编号。因此,我首先根据名称找到数字,然后在不同的注册表项中设置该值。
之后必须重置网络适配器,我使用 WMI 来完成此操作。
我在 MSDN 上的此线程中获得了帮助。
我不确定它是否适用于所有 Windows 操作系统,并且我不确定它是否适用于所有网络适配器。无论如何,这就是我所做的。
SOLUTION After working with this a bit, I found a solution. First i used Process monitor to figure out which registry values were changed, when I changed the wireless mode manually.
Now changing the value contains 2 steps. The name for the wireless modes are mapped to a number. The numbers are then mapped in a different registry key to a wireless mode number. So first I found the number based on the name, and then I set the value in a different registry key.
After that the Network adapter has to be reset, which I used WMI to do.
I got help in This thread on MSDN.
I am not sure, if it works across all windows OS, and I am not sure if it works across all network adapters. Anyways, this is what I did.
有一个 API 可以访问所有 wifi 网络适配器。您可以在此处找到其源代码。希望这能让你开始。
There is a API written to access all wifi network adapters. You can find its source code at here. Hope that should get you started.