private void timer1_Tick(object sender, EventArgs e) { string[] strsp = { "\n" }; String[] str =txtInfo.Text.Split(strsp,StringSplitOptions.RemoveEmptyEntries); string command = ""; if (str.Length > 1) { //statusStrip1.Text = str[str.Length - 1]; txtInfo.Text= str[str.Length - 1]; command = str[str.Length - 1]; } if (command.Trim () == "10V16,22.") { try { System.Diagnostics.Process.Start(@"C:\会商.exe"); command = ""; Thread.Sleep(8000); } catch (Exception ex) { } txtInfo.Text = ""; command = ""; } } } |
|