大家好,我想使用 c#,VS10 通过 rs-232 串行发送/接收数据......我这样做的代码如下......
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(均为女性端)进行通信。但是我通过发送按钮从一台电脑发送的数据没有被另一台电脑接收到......我现在该怎么办......