C# Class LibUsbDotNet.Main.UsbSymbolicName

USB device symbolic names are persistent accrossed boots and uniquely identify each device.
As well as uniquely identify connected devices, the UsbSymbolicName class parses the symbolic name key into usable fields.
显示文件 Open project: arvydas/BlinkStickDotNet Class Usage Examples

Private Properties

Property Type Description
Parse void
UsbSymbolicName System

Public Methods

Method Description
Parse ( string identifiers ) : UsbSymbolicName

Parses registry strings containing USB information. This function can Parse symbolic names as well as hardware ids, compatible ids, etc.

List<UsbRegistryDeviceInfo> regDeviceList = UsbGlobals.RegFindDevices(); foreach (UsbRegistryDeviceInfo regDevice in mDevList) { string[] hardwareIds = (string[])regDevice.Properties[DevicePropertyType.HardwareID]; UsbSymbolicName usbHardwareID = UsbSymbolicName.Parse(hardwareIds[0]); Debug.Print(string.Format("Vid:0x{0:X4} Pid:0x{1:X4}", usbHardwareID.Vid, usbHardwareID.Pid)); }

ToString ( ) : string

Returns a T:System.String that represents the current UsbSymbolicName.

Private Methods

Method Description
Parse ( ) : void
UsbSymbolicName ( string symbolicName ) : System

Method Details

Parse() public static method

Parses registry strings containing USB information. This function can Parse symbolic names as well as hardware ids, compatible ids, etc.
List<UsbRegistryDeviceInfo> regDeviceList = UsbGlobals.RegFindDevices(); foreach (UsbRegistryDeviceInfo regDevice in mDevList) { string[] hardwareIds = (string[])regDevice.Properties[DevicePropertyType.HardwareID]; UsbSymbolicName usbHardwareID = UsbSymbolicName.Parse(hardwareIds[0]); Debug.Print(string.Format("Vid:0x{0:X4} Pid:0x{1:X4}", usbHardwareID.Vid, usbHardwareID.Pid)); }
public static Parse ( string identifiers ) : UsbSymbolicName
identifiers string
return UsbSymbolicName

ToString() public method

Returns a T:System.String that represents the current UsbSymbolicName.
public ToString ( ) : string
return string