Claire,
I think that the way that you are going about it isn't the best. If you
can, I would use the classes in the System.Management namespace to create a
WMI query for all instances of Win32_SerialPort. This would probably be
faster than looping through and catching exceptions (which is expensive).
An added benefit is that if you query for instances of Win32_SerialPort,
then you can get all the other information you need about it (if it is
available or not).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Claire" <bl****@blahhhhh.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
Regarding IOException
I'm catching this error while querying for available serial ports using a
third party component.
I attempt to open then close the comport and if this error type is thrown
then I don't list the port in a combo box.
But I would like to discern between a comport not being available and one
that is available but in use, easy with getlasterror.
Is it possible to do this?