如题,谢谢.
我看WIN32_NETWORKADAPTER中没有可以获取连接名称的项,也没有获取速度的项.

解决方案 »

  1.   

    获取网速,用性能计数器,参考一下PerformanceCounter类。
    PerformanceCounter使用例子(获取CPU使用率):using System; 
    using System.Diagnostics; 
    using System.Threading; namespace ConsoleApplication6 

       class Class1 
       { 
          [STAThread] 
          static void Main(string[] args) 
          { 
             Process[] process = Process.GetProcesses(); 
             PerformanceCounter PC = new PerformanceCounter(); 
             foreach(Process p in process) 
             { 
                PC.CategoryName = "Process"; 
                PC.CounterName = "% Processor Time"; 
                PC.InstanceName = p.ProcessName;//"Idle"; 
                Thread.Sleep(1000); 
                float fl = PC.NextValue(); 
                Console.WriteLine(PC.NextValue().ToString() + p.ProcessName + fl); 
                Console.WriteLine(); 
             } 
          }    
       } 
    }
      

  2.   

    Monitoring network speed
    http://www.codeproject.com/csharp/networkmonitorl.asp