注册 登录
编程论坛 C# 论坛

请教:Serialport控件write方法能使用Byte型参数吗?

wcsnf609 发布于 2014-03-26 11:18, 469 次点击
我想每次发送一个字节(8bits),如何实现?恳求赐教。
1 回复
#2
无名小草2014-04-02 23:49
SerialPort.Write 方法 (Byte[], Int32, Int32)
public void Write(
 byte[] buffer,
 int offset,
 int count
)
参数
buffer
    类型:System.Byte[]
    包含要写入端口的数据的字节数组。
offset
    类型:System.Int32
    buffer 参数中从零开始的字节偏移量,从此处开始将字节复制到端口。
count
    类型:System.Int32
    要写入的字节数。
1