public Form1()
{
InitializeComponent();
try
{
this.ComPort = new System.IO.Ports.SerialPort("COM1", 9600, System.IO.Ports.Parity.Even, 8, System.IO.Ports.StopBits.One);
this.ComPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(ComPort_DataReceived);
this.ComPort.Open();
}
catch (System.Exception e)
{
//Error Message e
}
}
private void ComPort_DataReceived(Object sender,EventArgs e)
{
string strData = this.ComPort.ReadLine()
//To Do add code here!
}
Date :
2010-03-08 13:27:07
By :
tungman
No. 2
Guest
มีError ขึ้นมาแบบนี้ค่ะ
" ASC.Form1 does not contain a definition for 'ComPort' and no extension method 'ComPort' accepting a first argument of type 'ASC.Form1' could be found (are you missing a using directive or an assembly reference?)"