About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
PortController Sample Projects
Handling PortController Errors
Reference
Properties
AvailableSystemPorts
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
ForceBeginInvokeEventFiring Property
IsOpen Property
IsFileTransferInProgress Property
Parity Property
PortHandle Property
PortName Property
ReceiveBufferSize Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
SystemPorts Property
TraceOutput Property
TransmitBufferSize
XoffByte Property
XonByte Property
XonXoff Property
Methods
CancelFileTransfer Method
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
ReceiveFileXModem Method
ReceiveFileXModemCRC Method
ReceiveFileYModem Method
ReceiveFileZModem Method
SendFileXModem Method
SendFileXModem1k Method
SendFileYModem Method
SendFileZModem Method
SimulateReceivedXoff Method
SimulateReceivedXon Method
Write Method
WriteBinary Method
Events
OnBreakSignal Event
OnCdToggle Event
OnCtsToggle Event
OnDataReceived Event
OnDsrToggle Event
OnError Event
OnEventCharReceived Event
OnFileTransferComplete Event
OnFileTransferStatusUpdate Event
OnRing Event
OnTQEmpty Event

SystemPorts Property

Returns a collection of the names of COM ports in the system.

Syntax

[Visual Basic]
object.SystemPorts

[C#]
object.SystemPorts

[C++]
object->SystemPorts

Parameters

object

An object expression that evaluates to a PortController object.

Return Value

A StringCollection containing the names of the serial ports in the system.

Default

Empty

Remarks

This property returns the names of the ports that exist on the system, including ports that are in use by other processes (that is, each port that cannot currently be opened). To get a list of all ports on the system that are openable, examine the AvailableSystemPorts property.

Errors

If PortController is unable to determine the COM ports on the system, an "Unable to enumerate system ports." exception is thrown. It is likely, however, you will still be able to open a port directly using the Open() method.

Example

[Visual Basic]
Dim SystemPorts As System.Collections.Specialized.StringCollection
SystemPorts = myPortController.SystemPorts


[C#]
System.Collections.Specialized.StringCollection SystemPorts;
SystemPorts = myPortController.SystemPorts;


[C++]
System::Collections::Specialized::StringCollection *SystemPorts;
SystemPorts = myPortController->SystemPorts;

See Also

AvailableSystemPorts property | Open method