没有WMI禁用网络适配器网络适配器、WMI

2023-09-06 15:14:58 作者:飞花似梦

我找到了一些答案对谷歌描述了如何使用WMI来禁用网络适配器本地连接上的Windows 7和8。我还发现了一个方法,通过使用shell,但它仅适用于Windows XP。我想知道,如果它可以禁用适配器,而无需使用WMI使用C#或VB.NET code在Win7和Win8的。

I found a few answers on google describing how to disable the network adapter "Local Area Connection" on Windows 7 and 8 by using WMI. I also found a method by using shell but it only works with Windows XP. I would like to know if its possible to disable adapters without using WMI with C# or VB.NET code on Win7 and Win8..

推荐答案

您可以做这样的事情:

Process.Start("cmd.exe","/c netsh interface set interface 'Local Area Connection' DISABLED");