// Obtain the number of bytes waiting in the port's buffer获得的字节数放在串口的缓冲区 int bytes = comport.BytesToRead; // Create a byte array buffer to hold the incoming data创建一个字节数组缓冲来保存传入的数据 byte[] buffer = new byte[bytes]; // Read the data from the port and store it in our buffer从串口读取数据并将其存储在缓冲中 comport.Read(buffer, 0, bytes);
for (int i = 0; i < buffer.Length; i++)
{
buf.Add(buffer[i]);
}
这是我从串口读取的数据保存在buf数组里面,请问接下怎么把数据保存到Excel里面
for (int i = 0; i < buffer.Length; i++)
{
buf.Add(buffer[i]);
}
这是我从串口读取的数据保存在buf数组里面,请问接下怎么把数据保存到Excel里面
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货