G
Guest
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?
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?