473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

System.IO.Ports.SerialPort.GetPortNames return wrog names above CO

Hello all!

MY CASE:

I'm using VB.net 2005 express on a Dell Laptop with an USB Bluetooth key.
I'm trying to send data to a pocketPC.
COM numbers changes each time i've got a new bluetooh "connection" with my
PDA.
I need 2 ports, one for ingoing data, one for outgoing data (that's how
serial port profile in bluetooth is made)
Sometime it's COM 5 and 6, some time 11 and 12.

I'm using this code to get the port names, display them in a combobox to let
the user choosing the right one:
in the Form load event:
Dim ports As String() = System.IO.Ports.SerialPort.GetPortNames
Dim port As String
For Each port In ports
PortIn_List.Add(port)
PortOut_List.Add(port)
Next port
'CMB_xxxx are combobox
CMB_PortNumIn.DataSource = PortIn_List
CMB_PortNumOut.DataSource = PortOut_List

In the OK button:
SerialPortIn.PortName = CMB_PortNumIn.Text
SerialPortOut.PortName = CMB_PortNumOut.Text

MY PROBLEM:

with all COM numbers under 10, no problem, but with COM number above 9 (11
and 12 in my case), getportnames return "COM11c" and "COM12c"!
Is anybody can "duplicate" this error? Is it a bug?
Feb 27 '06 #1
3 10085
Hi Sam,

"COM11c" and "COM12c"!
<<

When you use these values to set the port, do they work, or is there an
error? I don't have any BT hardware to test right now, but I don't see this
with some other virtual serial port drivers for hardware that I do have
installed.

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.
See www.hardandsoftware.net for details and contact information.
Feb 27 '06 #2
No, it doesn't work with those names. I have to write "COM11" and "COM12" in
the comboboxes!
Are you able to test this function with a high numbuer next to COM?

"Dick Grier" wrote:
Hi Sam,

"COM11c" and "COM12c"!
<<

When you use these values to set the port, do they work, or is there an
error? I don't have any BT hardware to test right now, but I don't see this
with some other virtual serial port drivers for hardware that I do have
installed.

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.
See www.hardandsoftware.net for details and contact information.

Feb 27 '06 #3
Hello Dick, i have download VSterm from your pages and the problem is the same!
I can email you a capture of my screen with "COM14c" and "COM13c" in your
settings form of VSTerm! When I select them, no problem, but when I try to
open it, nothing happen, and the port open item in the menu is not checked!

It seems that when I move my usb dongle from Usb port to Usb Hub, COM number
change, that's why today, number are 13 and 14.
My Usb dongle is a "Top suxess" one, The chipset came from CSR, the driver
from Microsoft, V 5.1.2600.2180

"Dick Grier" wrote:
Hi Sam,

"COM11c" and "COM12c"!
<<

When you use these values to set the port, do they work, or is there an
error? I don't have any BT hardware to test right now, but I don't see this
with some other virtual serial port drivers for hardware that I do have
installed.

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.
See www.hardandsoftware.net for details and contact information.

Feb 28 '06 #4

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

Similar topics

1
by: henrycortezwu | last post by:
Hi All, I'm trying to connect to a virtual port (COM19, OUTGOING, "Bluetooth Serial Port") using VS2005 System.IO.Ports. When I ran the ff code below here's what happens. 1) VS2005 Compiles w/o...
1
by: James L | last post by:
Is there any code to get the number of comm ports detected by the pc? Cheers.
4
by: Joachim | last post by:
How can I find out what COM ports that exists on my computer?
7
by: Tamir.D | last post by:
is there a way to embed the System.IO.Ports.SerialPort object in my html . so that the client can access to a device connected to his SerialCOM ? i tried to wrap the System.IO.Ports.SerialPort in...
5
by: LongBow | last post by:
Hello, Is there a way, in .NET, to determine what are the avialable Serial (Communications) Ports on a Windows OS and is there a way to determine that port isn't being use other than attempting...
7
by: TClancey | last post by:
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...
3
by: Mugunth | last post by:
Hi, I've a strange problem with serial port class of .NET Framework 2.0 I use com0com (Null Modem COM Port emulator) to emulate a virtual port. This application creates virtual com port pairs...
3
by: Bandu | last post by:
hi, i'm using serial port functionality provided by .net framework 2.0 using system.io.ports. Is there anyway that i can set DTR/DSR handshaking? Regards, Bandu
1
by: JDS | last post by:
I am getting the following error in my application: System.UnauthorizedAccessException was unhandled Message="Access to the port is denied." Source="System" StackTrace: at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.