Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

SerialPortNames Property

Location

My.Computer.Ports.SerialPortNames

Syntax

Dim result As System.Collections.Generic.ReadOnlyCollection( _ Of String) = My.Computer.Ports.SerialPortNames

Description

The SerialPortNames property returns a collection of serial port names available on the local computer.

Usage at a Glance

  • This property is read-only.

  • This property is not valid in ASP.NET applications.

Example

The following example displays all serial port names in a list box.

ListBox1.DataSource = My.Computer.Ports.SerialPortNames

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Ports.SerialPortNames Property

  • System.IO.Ports.SerialPort.GetPortNames Method

See Also

OpenSerialPort Method, Ports Object

Категории