using System.IO.Ports;
命名空間SerialPorts
{
public class SerialPorts
{ ## ReadSerialPorts ()
{
卷 mySerialPort.Parity = 奇偶校驗。無;
mySerialPort.StopBits = StopBits.One;
mySerialPort.DataBits = 8885;dm.
# # mySerialPort. DataReceived = new SerialDataReceivedEventHandler(DataReceive_Method); oid DataReceive_Method(object sender,SerialDataReceivedEventArgs e) { SerialPort sp = (SerialPort)sender;# string indata = sp.ReadExisting); } }目前問題是,可以使用執行緒傳出串列埠的快取數據,但是執行緒不能斷開,否則開啟再接不到資料怎麼辦。能把indata值傳出嗎?我打算把這個外接類別庫,然後提供JQUERY或Javascript呼叫。