Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在谷歌上找到了一些答案,描述了如何使用 WMI 在 Windows 7 和 8 上禁用网络适配器“本地连接”。我还找到了一种使用 shell 的方法,但它只适用于 Windows XP。我想知道是否可以在 Win7 和 Win8 上使用带有 C# 或 VB.NET 代码的 WMI 来禁用适配器。
你可以这样做:
Process.Start("cmd.exe","/c netsh interface set interface 'Local Area Connection' DISABLED");