SerialPort.NewLine SerialPort.NewLine SerialPort.NewLine SerialPort.NewLine Property

定义

获取或设置用于解释 ReadLine()WriteLine(String) 方法调用结束的值。Gets or sets the value used to interpret the end of a call to the ReadLine() and WriteLine(String) methods.

public:
 property System::String ^ NewLine { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
public string NewLine { get; set; }
member this.NewLine : string with get, set
Public Property NewLine As String

属性值

表示行尾的值。A value that represents the end of a line. 默认值为换行符(在中C# vbLf为 "\n",在 Visual Basic 中为)。The default is a line feed ("\n" in C# or vbLf in Visual Basic).

异常

属性值为空。The property value is empty.

注解

此属性确定的值(byte)定义了ReadLineWriteLine方法的行尾。This property determines what value (byte) defines the end of a line for the ReadLine and WriteLine methods. 默认情况下,\n C# Constants.vbLf行尾值是换行字符(在 Visual Basic 中)。By default the end-of-line value is a line feed character (\n in C#, Constants.vbLf in Visual Basic). 如果正在使用的特定串行设备对同一目的使用不同的值,则会将此值更改为其他值。You would change this to a different value if the particular serial device you're working with uses a different value for the same purpose.

适用于