This documentation is archived and is not being maintained.
SerialPort Methods
Visual Studio 2010
The SerialPort type exposes the following members.
| Name | Description | |
|---|---|---|
|
Close | Closes the port connection, sets the IsOpen property to false, and disposes of the internal Stream object. |
|
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.) |
|
DiscardInBuffer | Discards data from the serial driver's receive buffer. |
|
DiscardOutBuffer | Discards data from the serial driver's transmit buffer. |
|
Dispose() | Releases all resources used by the Component. (Inherited from Component.) |
|
Dispose(Boolean) | Releases the unmanaged resources used by the SerialPort and optionally releases the managed resources. (Overrides Component::Dispose(Boolean).) |
|
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Finalize | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.) |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
|
GetPortNames | Gets an array of serial port names for the current computer. |
|
GetService | Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.) |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
|
MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) |
|
Open | Opens a new serial port connection. |
|
Read(array<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. |
|
Read(array<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. |
|
ReadByte | Synchronously reads one byte from the SerialPort input buffer. |
|
ReadChar | Synchronously reads one character from the SerialPort input buffer. |
|
ReadExisting | Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the SerialPort object. |
|
ReadLine | Reads up to the NewLine value in the input buffer. |
|
ReadTo | Reads a string up to the specified value in the input buffer. |
|
ToString | Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.) |
|
Write(String) | Writes the specified string to the serial port. |
|
Write(array<Byte>, Int32, Int32) | Writes a specified number of bytes to the serial port using data from a buffer. |
|
Write(array<Char>, Int32, Int32) | Writes a specified number of characters to the serial port using data from a buffer. |
|
WriteLine | Writes the specified string and the NewLine value to the output buffer. |
Show: