Home All Groups Group Topic Archive Search About
Author
28 Nov 2006 3:33 PM
TClancey
Hi.

I have an app that is going to connect to several virtual com ports,
although the system will see them as 'real'.

How can I list the installed com ports on the system?  I've found
System.Io.Ports.xxx but there isn't a count or enumerator?

Any ideas?

Cheers,
Tull.

Author
28 Nov 2006 5:49 PM
Michel van den Berg
Is this helpfull?
http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/default.aspx


TClancey schreef:

Show quoteHide quote
> Hi.
>
> I have an app that is going to connect to several virtual com ports,
> although the system will see them as 'real'.
>
> How can I list the installed com ports on the system?  I've found
> System.Io.Ports.xxx but there isn't a count or enumerator?
>
> Any ideas?
>
> Cheers,
> Tull.
Author
30 Nov 2006 11:16 AM
TClancey
Not really, I'm using vb 2005 so there is a SerialPort control available.  I
just need to know how to list the ports in teh system.

Thanks,
Tull.

Show quoteHide quote
"Michel van den Berg" <m**@promontis.nl> wrote in message
news:1164736146.277002.66470@j72g2000cwa.googlegroups.com...
> Is this helpfull?
> http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/default.aspx
>
>
> TClancey schreef:
>
>> Hi.
>>
>> I have an app that is going to connect to several virtual com ports,
>> although the system will see them as 'real'.
>>
>> How can I list the installed com ports on the system?  I've found
>> System.Io.Ports.xxx but there isn't a count or enumerator?
>>
>> Any ideas?
>>
>> Cheers,
>> Tull.
>
Author
28 Nov 2006 6:45 PM
Dick Grier
Hi,

The PortName method returns a String array of installed ports.  You can
download example code from my homepage that illustrates this.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
30 Nov 2006 11:17 AM
TClancey
Thanks Dick, which download are you refering to?  You have quite a few.

I've tried using GetPortNames.ToString all I get is  System.String[]

Cheers,
Tull.

Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:%23PVr90xEHHA.2356@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> The PortName method returns a String array of installed ports.  You can
> download example code from my homepage that illustrates this.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>
Author
30 Nov 2006 11:21 AM
TClancey
Sorry I see what you mean now.

However if I try

Dim p() As String
p = IO.Ports.SerialPort.GetPortNames
MsgBox(UBound(p))
All I get is '0'


Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:%23PVr90xEHHA.2356@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> The PortName method returns a String array of installed ports.  You can
> download example code from my homepage that illustrates this.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>
Author
30 Nov 2006 6:08 PM
Dick Grier
Hi,

This is odd.  I have no trouble with both actual physical ports AND virtual
serial ports.  Does HyperTerminal "see" the VP?  I assume that when you run
my example, you also do not see your ports?

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
1 Dec 2006 11:07 AM
TClancey
I wasn't sure which example to download, can you please let me know and I'll
try it.

HT sees the com port without any problems.  I can open the port in VB and
get data, I just can't get the list of ports back.  Unless I'm doing
something completely wrong!


Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:%23YNCupKFHHA.1216@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> This is odd.  I have no trouble with both actual physical ports AND
> virtual serial ports.  Does HyperTerminal "see" the VP?  I assume that
> when you run my example, you also do not see your ports?
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>