日期:2014-05-17 浏览次数:20978 次
private static void DataReceviedHandler(
object sender,
SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
string indata = sp.ReadExisting();
insertStr += indata;
foreach (char ch in insertStr)
{
if (ch != 'E' && ch != 'S'&& ch != 'o')
{
usingStr += ch;
}
}
string RealName = "";
switch (usingStr)
{
case "2011072069\0":
RealName = "a";
break;
case "2010073065\0":
RealName = "b";
break;
case "2011072069":
RealName = "a";
break;
case "2010073065":
RealName = "b";
break;
default:
&nb