listing all the ports

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hello All,

I am wanting to list all the port like when you go to
printers--> right click properties--> then pick the Port
tab. And you will see a list of available ports. How do I
list these and any info related to each port? I am writing
in C# , so I would greatly appreciate a small example in
C#.

Thank You in Advance for Your Help,
Ken
 
* "Ken said:
I am wanting to list all the port like when you go to
printers--> right click properties--> then pick the Port
tab. And you will see a list of available ports. How do I
list these and any info related to each port? I am writing
in C# , so I would greatly appreciate a small example in
C#.


Sorry, I don't have a C# sample, but this VB Classic sample will point
you in the right direction:

<http://www.mvps.org/vbnet/index.html?code/enums/enumports.htm>
 
Hi Ken,
You may call the Windows API EnumPorts to get the available ports.
However, I'd like to say it is not easy to invoke this API because it
returns a variable-length structure array,
Here is a FAQ written by our MVP , I think it will be helpful to you.
And if it is possible, I think creating a wrapper class using managed c++
for this api maybe better.
Please be free to let me know if you have problem to do this.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| Content-Class: urn:content-classes:message
| From: "Ken" <[email protected]>
| Sender: "Ken" <[email protected]>
| Subject: listing all the ports
| Date: Fri, 10 Oct 2003 12:45:26 -0700
| Lines: 12
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOPZw1NXQ8DZXVFTrmM7+IjIkz5lg==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:54190
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hello All,
|
| I am wanting to list all the port like when you go to
| printers--> right click properties--> then pick the Port
| tab. And you will see a list of available ports. How do I
| list these and any info related to each port? I am writing
| in C# , so I would greatly appreciate a small example in
| C#.
|
| Thank You in Advance for Your Help,
| Ken
|
|
 
Hi Ken,
You may call the Windows API EnumPorts to get the available ports.
However, I'd like to say it is not easy to invoke this API because it
returns a variable-length structure array,
Here is a FAQ written by our MVP , I think it will be helpful to you.

http://www.dotnetinterop.com/faq/?q=VariableLengthStruct

And if it is possible, in my opnion, creating a wrapper class in managed
c++ for this api maybe better.

Please be free to let me know if you have problem to do this.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| From: (e-mail address removed) (Ying-Shen Yu[MSFT])
| Organization: Microsoft
| Date: Mon, 13 Oct 2003 05:06:28 GMT
| Subject: RE: listing all the ports
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
|
| Hi Ken,
| You may call the Windows API EnumPorts to get the available ports.
| However, I'd like to say it is not easy to invoke this API because it
| returns a variable-length structure array,
| Here is a FAQ written by our MVP , I think it will be helpful to you.
| And if it is possible, I think creating a wrapper class using managed c++
| for this api maybe better.
| Please be free to let me know if you have problem to do this.
| Thanks!
|
| Best regards,
|
| Ying-Shen Yu [MSFT]
| Microsoft Online Partner Support
| Get Secure! - www.microsoft.com/security
|
| This posting is provided "AS IS" with no warranties and confers no rights.
| You should not reply this mail directly, "Online" should be removed
before
| sending, Thanks!
|
| --------------------
| | Content-Class: urn:content-classes:message
| | From: "Ken" <[email protected]>
| | Sender: "Ken" <[email protected]>
| | Subject: listing all the ports
| | Date: Fri, 10 Oct 2003 12:45:26 -0700
| | Lines: 12
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="iso-8859-1"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Thread-Index: AcOPZw1NXQ8DZXVFTrmM7+IjIkz5lg==
| | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| | Newsgroups: microsoft.public.dotnet.framework.windowsforms
| | Path: cpmsftngxa06.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.windowsforms:54190
| | NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| | X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
| |
| | Hello All,
| |
| | I am wanting to list all the port like when you go to
| | printers--> right click properties--> then pick the Port
| | tab. And you will see a list of available ports. How do I
| | list these and any info related to each port? I am writing
| | in C# , so I would greatly appreciate a small example in
| | C#.
| |
| | Thank You in Advance for Your Help,
| | Ken
| |
| |
|
 
Back
Top