473,729 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How many comm ports??

Is there any code to get the number of comm ports detected by the pc?

Cheers.
Mar 1 '06 #1
1 1670
Hi,

Using .NET 2.0:

Console.Writeli ne("Found " + SerialPort.GetP ortNames().Leng th
+ " serial ports, enumerating:");
foreach (string s in SerialPort.GetP ortNames())
{
Console.Writeli ne(s);
}

Janiek

On Wed, 1 Mar 2006 04:43:28 -0800, "James L"
<Ja****@discuss ions.microsoft. com> wrote:
Is there any code to get the number of comm ports detected by the pc?

Cheers.


Mar 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2148
by: Greg Pedder | last post by:
Hello. I have an application that uses the Java Communications API to use a modem. At startup, the application checks to see what serial devices are connected. For each serial device, the app tries to write some "AT" commands to make sure it gets back "OK" from the modem. At this point all the ports are closed and the application goes into a serversocket accept blocking call and waits for any connections.
1
1936
by: Ky Nguyen | last post by:
Hi all, I would like to obtain a piece of codes (a full version or just an example) dealing with asynchronous communication via COM: serial port. I dont mind whether it is window-based or console-based. If someone knows a good source that documents how to establish, send, and receive via serial port, please direct me there. Thanks in advance.
3
9328
by: andyI | last post by:
Where do I find information on how to address and pass data to and from the serial ports and USB ports in VB. VB6 supports the serial ports easily but I see no reference to using the USB ports. VB.net literature does not provide any coverage on either the serial ports or the USB ports.
3
1531
by: Steve | last post by:
Hi All and seasons greetings. Is there an easy way of getting a list of current Comm ports on a machine? I suspect that most machines these days have 1 and 2, but there could be others and I would like to get a list of them to offer the end user. Many thanks, Steve.
7
3698
by: Padu | last post by:
Hi Everybody, I'm a newcomer from the Delphi world and I'm going to start developing my new project (a robot control app) in C#. One of the requirements is to communicate using RS232 (well, RS485, but the app doesn't care really). I was googling a bit and I saw a couple of good articles using P/Invoke, and I'll probably do that, unless I find something like Turbopower's Async (find them on sourceforge.net). It is a very powerful...
0
1432
by: joaquimfpinto | last post by:
Hi All, I've an application that write and read from different serial ports. I made a class with an object from Charon Communications. On the main form I create several instances of that class, depending on the number of serial ports I want to handle, and control any input data with a timer that is checking the machine attached to the serial port and whenever there is information the data available is triggered.
2
1911
by: Hank | last post by:
Hello, I would like to get some opinions on using the Comm Port with Access 2000. We have a few jobs coming in that require us to interface with a PLC via the Comm Port. My partner feels we should use a Visual Basic Front End and the VB component as opposed to Access. Has anyone had good luck interfacing to a Comm Port using Access?
0
1098
by: alvatar | last post by:
I am doing a project on microcontrollers and want to be able to send and receive data via RS232 serial cable. Right now, my PIC microcontroller code is able to send string data to the computer and HyperTerminal will output the strings. However, in order to manipulate such data I found out that Visual Basic is needed. So I tried creating a basic Visual Basic window application using VB Express 2008 just to read bytes sent from serial, using...
9
6474
by: rajujrk | last post by:
hi, currently i am doing the project to send the sms from PC to Mobile and vice versa using GSM modem. I successfully done this process in Hyperterminal. First i connect the GSM modem in COM1 port then set the baud rate to 9600 and execute the AT commands in hyperterminal and its works fine.. But my problem is that to do the similar process in java..
0
8917
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.