detect com port information
detect com port information
detect com port information
detect com port information
detect com port information
detect com port information detect com port information detect com port information detect com port information detect com port information detect com port information detect com port information detect com port information
detect com port information detect com port information
detect com port information
Go Back  Xtreme Visual Basic Talk > > > detect com port information


Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2010, 12:05 PM
KevinVA KevinVA is offline
Regular
 
Join Date: Nov 2002
Location: Iowa
Posts: 59
Default detect com port information


Hi all,

I would like to detect information regarding all the possible com ports of a system. At minimum I need to see which ports are open (not used by another program) but it would also be nice to see a device name associated with the "busy" ports. I could sequence through all ports and use an error handler to detect which ones are not available but there should be a cleaner way to do this. Any ideas?

Thanks in advance,
Kevin
Reply With Quote
  #2  
Old 07-27-2010, 01:02 PM
webbone's Avatar
webbone webbone is offline
Hydrogen Powered

Administrator
* Expert *
 
Join Date: Jul 2003
Location: Sacramento, CA
Posts: 6,090
Default

Even if you use an API method you'd need to have some sort of loop checking each port.

You can use the MSComm control to access only COM ports 1-16. If this is sufficient for your needs it is a simple matter to loop through those port #'s and check to see if you can Open them. You'll either get error 8002 (unable to open - most likely means the port doesn't exist) or 8005 (in use - which means the port exists but another process has control of it).

You should also be careful about referring to "which ports are open" - normally the port being OPEN means a process (possibly even your own) has control of the port. A port which is not open but is AVAILABLE would be a better description
__________________
"With the appearance of the AddressOf operator, an entire industry has developed among authors illustrating how to do previously impossible tasks using Visual Basic. Another industry is rapidly developing among consultants helping users who have gotten into trouble attempting these tasks." -Dan Appleman
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
detect com port information
detect com port information
detect com port information detect com port information
detect com port information
detect com port information
detect com port information detect com port information detect com port information detect com port information detect com port information detect com port information detect com port information
detect com port information
detect com port information
 
detect com port information
detect com port information
 
-->