Does anyone know of a managed/unmanaged way of getting the Manufacturer value from the Communications Port Properties screen? See attached picture.
So far I have this, however it doesn't give me the Manufacturer name:
vb.net Code:
Public Sub WritePorts()
Using searcher As New System.Management.ManagementObjectSearcher("SELECT * FROM WIN32_SerialPort")
For Each port In searcher.Get()
Console.WriteLine(String.Join(Environment.NewLine, _
port.Properties.OfType(Of System.Management.PropertyData)().Select(Function(prop) _
String.Format("{0}: {1}", _
prop.Name, _
If(prop.Value Is Nothing, "NULL", prop.Value.ToString()))).ToArray()))
Next
End Using
End Sub
Note: You will need to add a reference to System.Management if you want to run this code.