如何继续从serialport接收数据

时间:2015-03-23 13:31:13

标签: c# dll

这是封装在我的dll中的类

public class CommClass
    {
    public SerialPort _port;
    //

    public CommClass(string _pname)
    {
        portList = SerialPort.GetPortNames();
        _port = new SerialPort(portList[0]);
        if (portList.Length < 1)
            _port= null;
        else
        {
            if(portList.Contains(_pname))
            { 
                _port = new SerialPort(_pname);
            //SerialPort _port = portList[0];
            //return _port; 
             }
        }
    }

我知道有一个SerialDataReceived,如何将它封装到我的dll中?

0 个答案:

没有答案