SerialPort.IsOpen SerialPort.IsOpen SerialPort.IsOpen SerialPort.IsOpen Property

定义

获取一个值,该值指示 SerialPort 对象的打开或关闭状态。Gets a value indicating the open or closed status of the SerialPort object.

public:
 property bool IsOpen { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool IsOpen { get; }
member this.IsOpen : bool
Public ReadOnly Property IsOpen As Boolean

属性值

如果串行端口已打开,则为 true;否则为 falsetrue if the serial port is open; otherwise, false. 默认值为 falseThe default is false.

异常

已传递的 IsOpen 值为空字符串。The IsOpen value passed is an empty string ("").

注解

IsOpen属性跟踪端口是否处于打开状态以供调用方使用,而不是由计算机上的任何应用程序打开该端口。The IsOpen property tracks whether the port is open for use by the caller, not whether the port is open by any application on the machine.

适用于