关于SerialPort类的一些东东

SerialPort 类语法 

Visual Basic(声明)
Public Class SerialPort
    Inherits Component
Visual Basic(用法)
Dim instance As SerialPort
C#
public class SerialPort : Component
C++
public ref class SerialPort : public Component
J#
public class SerialPort extends Component
JScript
public class SerialPort extends Component
 
继承层次结构
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.IO.Ports.SerialPort
公共构造函数
  名称 说明
Public method Supported by the .NET Compact Framework SerialPort 已重载。初始化 SerialPort 类的新实例。
公共字段
  名称 说明
Public field Static Supported by the .NET Compact Framework InfiniteTimeout 指示不应该发生超时。
公共属性
  名称 说明
Public property Supported by the .NET Compact Framework BaseStream 获取 SerialPort 对象的基础 Stream 对象。
Public property Supported by the .NET Compact Framework BaudRate 获取或设置串行波特率。
Public property Supported by the .NET Compact Framework BreakState 获取或设置中断信号状态。
Public property Supported by the .NET Compact Framework BytesToRead 获取接收缓冲区中数据的字节数。
Public property Supported by the .NET Compact Framework BytesToWrite 获取发送缓冲区中数据的字节数。
Public property Supported by the .NET Compact Framework CDHolding 获取端口的载波检测行的状态。
Public property Container  获取 IContainer,它包含 Component。(从 Component 继承。)
Public property Supported by the .NET Compact Framework CtsHolding 获取“可以发送”行的状态。
Public property Supported by the .NET Compact Framework DataBits 获取或设置每个字节的标准数据位长度。
Public property Supported by the .NET Compact Framework DiscardNull 获取或设置一个值,该值指示 Null 字节在端口和接收缓冲区之间传输时是否被忽略。
Public property Supported by the .NET Compact Framework DsrHolding 获取数据设置就绪 (DSR) 信号的状态。
Public property Supported by the .NET Compact Framework DtrEnable 获取或设置一个值,该值在串行通信过程中启用数据终端就绪 (DTR) 信号。
Public property Supported by the .NET Compact Framework Encoding 获取或设置传输前后文本转换的字节编码。
Public property Supported by the .NET Compact Framework Handshake 获取或设置串行端口数据传输的握手协议。
Public property Supported by the .NET Compact Framework IsOpen 获取一个值,该值指示 SerialPort 对象的打开或关闭状态。
Public property Supported by the .NET Compact Framework NewLine 获取或设置用于解释 ReadLine 和 WriteLine 方法调用结束的值。
Public property Supported by the .NET Compact Framework Parity 获取或设置奇偶校验检查协议。
Public property Supported by the .NET Compact Framework ParityReplace 获取或设置一个字节,该字节在发生奇偶校验错误时替换数据流中的无效字节。
Public property Supported by the .NET Compact Framework PortName 获取或设置通信端口,包括但不限于所有可用的 COM 端口。
Public property Supported by the .NET Compact Framework ReadBufferSize 获取或设置 SerialPort 输入缓冲区的大小。
Public property Supported by the .NET Compact Framework ReadTimeout 获取或设置读取操作未完成时发生超时之前的毫秒数。
Public property Supported by the .NET Compact Framework ReceivedBytesThreshold 获取或设置 DataReceived 事件发生前内部输入缓冲区中的字节数。
Public property Supported by the .NET Compact Framework RtsEnable 获取或设置一个值,该值指示在串行通信中是否启用请求发送 (RTS) 信号。
Public property Supported by the .NET Compact Framework Site  获取或设置 Component 的 ISite。(从 Component 继承。)
Public property Supported by the .NET Compact Framework StopBits 获取或设置每个字节的标准停止位数。
Public property Supported by the .NET Compact Framework WriteBufferSize 获取或设置串行端口输出缓冲区的大小。
Public property Supported by the .NET Compact Framework WriteTimeout 获取或设置写入操作未完成时发生超时之前的毫秒数。
受保护的属性
  名称 说明
Protected property CanRaiseEvents  获取一个指示组件是否可以引发事件的值。(从 Component 继承。)
Protected property DesignMode  获取一个值,用以指示 Component 当前是否处于设计模式。(从 Component 继承。)
Protected property Supported by the .NET Compact Framework Events  获取附加到此 Component 的事件处理程序的列表。(从 Component 继承。)
公共方法
  名称 说明
Public method Supported by the .NET Compact Framework Close 关闭端口连接,将 IsOpen 属性设置为 false,并释放内部 Stream 对象。
Public method CreateObjRef  创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。 (从 MarshalByRefObject 继承。)
Public method Supported by the .NET Compact Framework DiscardInBuffer 丢弃来自串行驱动程序的接收缓冲区的数据。
Public method Supported by the .NET Compact Framework DiscardOutBuffer 丢弃来自串行驱动程序的传输缓冲区的数据。
Public method Supported by the .NET Compact Framework Dispose 已重载。 释放 SerialPort 对象使用的非托管资源。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method GetLifetimeService  检索控制此实例的生存期策略的当前生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method Static Supported by the .NET Compact Framework GetPortNames 获取当前计算机的串行端口名称数组。
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method InitializeLifetimeService  获取控制此实例的生存期策略的生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method Supported by the .NET Compact Framework Open 打开一个新的串行端口连接。
Public method Supported by the .NET Compact Framework Read 已重载。 从 SerialPort 输入缓冲区中读取。
Public method Supported by the .NET Compact Framework ReadByte SerialPort 输入缓冲区中同步读取一个字节。
Public method Supported by the .NET Compact Framework ReadChar SerialPort 输入缓冲区中同步读取一个字符。
Public method Supported by the .NET Compact Framework ReadExisting 在编码的基础上,读取 SerialPort 对象的流和输入缓冲区中所有立即可用的字节。
Public method Supported by the .NET Compact Framework ReadLine 一直读取到输入缓冲区中的 NewLine 值。
Public method Supported by the .NET Compact Framework ReadTo 一直读取到输入缓冲区中的指定 value 的字符串。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework ToString  返回包含 Component 的名称的 String(如果有)。不应重写此方法。 (从 Component 继承。)
Public method Supported by the .NET Compact Framework Write 已重载。 将数据写入串行端口输出缓冲区。
Public method Supported by the .NET Compact Framework WriteLine 将指定的字符串和 NewLine 值写入输出缓冲区。
页首
受保护的方法
  名称 说明
Protected method Supported by the .NET Compact Framework Dispose 已重载。 已重写。 释放 SerialPort 对象使用的非托管资源。
Protected method Supported by the .NET Compact Framework Finalize  在通过垃圾回收将 Component 回收之前,释放非托管资源并执行其他清理操作。 (从 Component 继承。)
Protected method GetService  返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。 (从 Component 继承。)
Protected method Supported by the .NET Compact Framework MemberwiseClone  已重载。 (从 MarshalByRefObject 继承。)
页首
公共事件
  名称 说明
Public event Supported by the .NET Compact Framework DataReceived 表示将处理 SerialPort 对象的数据接收事件的方法。
Public event Supported by the .NET Compact Framework Disposed  添加事件处理程序以侦听组件上的 Disposed 事件。(从 Component 继承。)
Public event Supported by the .NET Compact Framework ErrorReceived 表示处理 SerialPort 对象的错误事件的方法。
Public event Supported by the .NET Compact Framework PinChanged 表示将处理 SerialPort 对象的串行管脚更改事件的方法。

你可能感兴趣的:(关于SerialPort类的一些东东)