Get USB Infomation

来源:互联网 发布:不要在淘宝请符 编辑:程序博客网 时间:2024/06/05 10:18
namespace ConsoleApplication1{  using System;  using System.Collections.Generic;  using System.Management; // need to add System.Management to your project references.  class Program  {    static void Main(string[] args)    {      var usbDevices = GetUSBDevices();      foreach (var usbDevice in usbDevices)      {        Console.WriteLine("Device ID: {0}, PNP Device ID: {1}, Description: {2}",            usbDevice.DeviceID, usbDevice.PnpDeviceID, usbDevice.Description);      }
0 0
原创粉丝点击