Export (0) Print
Expand All

SerialPort Methods

The SerialPort type exposes the following members.

  NameDescription
Public method Close Closes the port connection, sets the IsOpen property to false, and disposes of the internal Stream object.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method DiscardInBuffer Discards data from the serial driver's receive buffer.
Public method DiscardOutBuffer Discards data from the serial driver's transmit buffer.
Public method Dispose() Releases all resources used by the Component. (Inherited from Component.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the SerialPort and optionally releases the managed resources. (Overrides Component.Dispose(Boolean).)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Static member GetPortNames Gets an array of serial port names for the current computer.
Protected method GetService Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method MemberwiseClone() Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MemberwiseClone(Boolean) Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public method Open Opens a new serial port connection.
Public method Read(Byte[], Int32, Int32) Reads a number of bytes from the SerialPort input buffer and writes those bytes into a byte array at the specified offset.
Public method Read(Char[], Int32, Int32) Reads a number of characters from the SerialPort input buffer and writes them into an array of characters at a given offset.
Public method ReadByte Synchronously reads one byte from the SerialPort input buffer.
Public method ReadChar Synchronously reads one character from the SerialPort input buffer.
Public method ReadExisting Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the SerialPort object.
Public method ReadLine Reads up to the NewLine value in the input buffer.
Public method ReadTo Reads a string up to the specified value in the input buffer.
Public method ToString Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)
Public method Write(String) Writes the specified string to the serial port.
Public method Write(Byte[], Int32, Int32) Writes a specified number of bytes to the serial port using data from a buffer.
Public method Write(Char[], Int32, Int32) Writes a specified number of characters to the serial port using data from a buffer.
Public method WriteLine Writes the specified string and the NewLine value to the output buffer.
Top

Community Additions

ADD
Show:
© 2014 Microsoft