示例#1
0
文件: PingForm.cs 项目: BJFX/UWACN
 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("请选择一个正确的目的地址!");
     }
 }
示例#2
0
文件: PingForm.cs 项目: BJFX/UWACN
 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("请选择一个正确的目的地址!");
     }
 }
示例#3
0
文件: PingForm.cs 项目: BJFX/UWACN
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     SourceText.Clear();
     BackText.Clear();
     Commparelabel.Text = "---";
 }