Encoding Property

SerialPort.Encoding Property

 

Gets or sets the byte encoding for pre- and post-transmission conversion of text.

Namespace:   System.IO.Ports
Assembly:  System (in System.dll)

[BrowsableAttribute(false)]
public Encoding Encoding { get; set; }

Property Value

Type: System.Text.Encoding

An Encoding object. The default is ASCIIEncoding.

Exception Condition
ArgumentNullException

The Encoding property was set to null.

ArgumentException

The Encoding property was set to an encoding that is not ASCIIEncoding, UTF8Encoding, UTF32Encoding, UnicodeEncoding, one of the Windows single byte encodings, or one of the Windows double byte encodings.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft