大家好我想送/使用C#,VS10通過RS-232串行接收數據... 我對這樣做如下代碼.....RS-232通信用C#
SerialPort sp = new SerialPort();
//predefined values are baud rate =9600, parity=none, databits=8,stopbit=1
//for sending data I used a textbox same name itself and a button "sendbutton" which coded as follow
try
{
sp.WriteLine(textBox.Text);
textBox.Text = "";
}
catch (System.Exception ex)
{
baudRatelLabel.Text = ex.Message;
}
//for receiving data code is as follows
try
{
textBox.Text = "";
textBox.Text = sp.ReadLine();
}
catch (System.Exception ex)
{
baudRatelLabel.Text = ex.Message;
}
我在兩臺電腦上安裝了這個應用程序,並使用rs232(兩個女性結束)進行通信。但我發送按鈕從一個PC發送的數據不會被另一臺PC接收....我現在該怎麼辦.....
您使用的是Nmodem電纜嗎? – Martze
Yaa我使用Nullmodem電纜 –