private void ViaComm_Click(object sender, EventArgs e) { if (DestNodeName.Text != "") { byte[] cmd = Pack(); if (cmd.Length == 0) { return; } byte[] Serialcmd = SourceDataClass.CommPackage(171, cmd); if (MainForm.pMainForm.mapdoc.WriteMSPCommand(Serialcmd)) { BackText.Clear(); Commparelabel.Text = "---"; MainForm.pMainForm.mapdoc.MSPCmdFile.OpenFile(MainForm.pMainForm.SerialCmdPathInfo); MainForm.pMainForm.mapdoc.MSPCmdFile.BinaryWrite(Serialcmd); MainForm.pMainForm.mapdoc.MSPCmdFile.close(); MessageBox.Show("命令已发送!"); } } else { MessageBox.Show("请选择一个正确的目的地址!"); } }
private void ViaNet_Click(object sender, EventArgs e) { if (DestNodeName.Text != "") { byte[] cmd = Pack(); if (cmd.Length == 0) { return; } byte[] netcmd = SourceDataClass.NetPackage(cmd); MainForm.pMainForm.CommandLineWin.SendCommand("gd -n"); if (MainForm.pMainForm.CommandLineWin.SendData(netcmd))//正确发送 { BackText.Clear(); Commparelabel.Text = "---"; MessageBox.Show("命令已发送!"); } } else { MessageBox.Show("请选择一个正确的目的地址!"); } }
private void ClearBtn_Click(object sender, EventArgs e) { SourceText.Clear(); BackText.Clear(); Commparelabel.Text = "---"; }