SerialPort.Write Method (Char, Int32, Int32)
Assembly: System (in system.dll)
The character array that contains the data to write to the port.
The zero-based byte offset in the buffer parameter at which to begin copying bytes to the port.
The number of characters to write.
The buffer passed is a null reference (Nothing in Visual Basic).
The specified port is not open.
The offset or count parameters are outside a valid region of the buffer being passed. Either offset or count is less than zero.
offset plus count is greater than the length of the buffer.
The operation did not complete before the time-out period ended.
Use this method when you want to write to a character buffer to create output to a serial port.
By default, SerialPort uses ASCIIEncoding to encode the characters. ASCIIEncoding encodes all characters greater then 127 as (char)63 or '?'. To support additional characters in that range, set Encoding to UTF8Encoding, UTF32Encoding, or UnicodeEncoding.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.