GetSerialPort Method

Retrieves string value of serial port name.

Syntax

Visual Basic .NET
Function GetSerialPort(ByVal index As UInt16) As String 
Visual C#
String GetSerialPort(UInt16 index);

Parameters

index

[in] Index of serial port (0 ... number_of_ports - 1).

Return

String value representing serial port name.

Code Example

String PortName = "";

try
{
	UInt16 PortsCount = ftspcControl1.EnumSerialPorts();

	for (UInt16 i = 0; i < PortsCount; i++)
	{
		PortName = ftspcControl1.GetSerialPort(i);

		// Todo: add your code

	}
}
catch (FTSPCException E)
{
	MessageBox.Show("Error " + E.ErrorCode.ToString() + "\r\n" + 
	E.ErrorSource, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}