Retrieves string value of serial port name.
| Visual Basic .NET | Function GetSerialPort(ByVal index As UInt16) As String
|
|---|---|
| Visual C# | String GetSerialPort(UInt16 index);
|
index
[in] Index of serial port (0 ... number_of_ports - 1).
String value representing serial port name.
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);
}