in vb.net:
Dim comPortKey As RegisTryKey =
RegisTry.LocalMachine.OpenSubKey("HARDWARE\\DEVICE MAP\\SERIALCOMM")
Dim portNames() As String = comPortKey.GetValueNames()
Dim x As Integer
For x = 0 To portNames.Length- 1 Step x + 1
Dim comPortValue As String = CType(comPortKey.GetValue(portNames( x
)), String)
comPorts.Add(comPortValue, comPortValue)
Next
regards,
Robb Gilmore wrote:
Dean,
I have not done it for USB, but I have done it for COM ports and it works
well. You might be able to do something similar. Here is the code for COM
ports ( it is C# but should be easy to port to VB.NET):
RegistryKey comPortKey = Registry.LocalMachine.OpenSubKey(
"HARDWARE\\DEVICEMAP\\SERIALCOMM" );
string[] portNames = comPortKey.GetValueNames();
for( int x=0; x<portNames.Length; x++ )
{
string comPortValue = ( string )comPortKey.GetValue( portNames[ x ] );
comPorts.Add( comPortValue, comPortValue );
}
Hope that helps somewhat
-Robb