0

On Windows 8 when I right click on a PCIE device in Device Manager, in the Details tab, under property "PCI current link speed" I can read the PCIe link speed. The same can be done for the PCIe link width.

I'd like to access this information programmatically in a C# application. How do I do that? through WMI? And will the same work on Windows 7?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Phy2Dig
  • 1
  • 1
  • 2

1 Answers1

0

Hope this kicks you a little:

using System;
using System.Management;

namespace PCIeSpeedExample
{
class Program
{
    static void Main(string[] args)
    {
        ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\cimv2", "select * from Win32_NetworkAdapter");
        foreach (ManagementObject obj in searcher.Get())
        {
            Console.WriteLine("--------------- Adapter ----------------");
            foreach (PropertyData pd in obj.Properties)
            {
                Console.WriteLine("{0} = {1}", pd.Name, pd.Value);
            }

        }
        Console.Read();
    }
}
}
Miroslav Endyš
  • 154
  • 1
  • 8