All:

I tried Vipul's suggestion on my computer and it worked fine until I
installed a USB serial port device.  The original poster's solution of
looking in the registry showed the new device just fine on COM4 which also
showed up in the control panel by navigating to:
    System - Hardware - Device Manager - Ports (COM & LPT).
However, the new COM4 did not show up using the ManagementClass method.

I presume that there must be yet another way to find all logical COM
devices installed.

:Kevin
Kevin Hood
Advanced Bionics Corp.

>Hi,
>
>The solution lied in the System.Management namespace.
>
>ManagementClass mc = new ManagementClass("Win32_SerialPort");
>System.Management.ManagementObjectCollection moc = mc.GetInstances();
>foreach (ManagementObject port in moc)
>{
>  MessageBox.Show("Port = " + port["deviceid"]);
>}

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to