How to disable/enable network connection in c#
问题 Basically I'm running some performance tests and don't want the external network to be the drag factor. I'm looking into ways of disabling network LAN. What is an effective way of doing it programmatically? I'm interested in c#. If anyone has a code snippet that can drive the point home that would be cool. 回答1: Found this thread while searching for the same thing, so, here is the answer :) The best method I tested in C# uses WMI. http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx Win32