SerialPort.DiscardNull 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示在埠與接收緩衝區間傳輸時,空位元組是否被忽略。
public:
property bool DiscardNull { bool get(); void set(bool value); };
public bool DiscardNull { get; set; }
[System.ComponentModel.Browsable(true)]
public bool DiscardNull { get; set; }
member this.DiscardNull : bool with get, set
[<System.ComponentModel.Browsable(true)>]
member this.DiscardNull : bool with get, set
Public Property DiscardNull As Boolean
屬性值
true 若忽略空位元組;否則 false。 預設值為 false。
- 屬性
例外狀況
備註
此值通常應設為 false,尤其是二進位傳輸時。 將此屬性設為 可能會 true 對 UTF32 和 UTF16 編碼位元組產生意想不到的結果。