private void CheetahConnect_Click(object sender, EventArgs e)
        {
            string IP_address = "localhost";

            if (mNetComClient.ConnectToServer(IP_address))
            {
                var isNlxConnected = mNetComClient.AreWeConnected();
                if (!isNlxConnected)
                {
                    MessageBox.Show(this, "Connection to server failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
                else
                {
                    MessageBox.Show(this, "Connected to Server", "NetCom Success", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                }


                cheetahConnected            = true;
                CheetahConnect.BackColor    = Color.DarkSlateGray;
                cheetahDisconnect.BackColor = Color.Transparent;
            }
            else
            {
                MessageBox.Show(this, "Connection to server failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Exemple #2
0
 private void confirm(object sender, EventArgs e)
 {
     if (mNetComClient.ConnectToServer(this.IP_address.Text))
     {
         var isNlxConnected = mNetComClient.AreWeConnected();
         if (!isNlxConnected)
         {
             MessageBox.Show(this, "Connection to server failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
         }
         else
         {
             MessageBox.Show(this, "Connected to Server", "NetCom Success", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         }
         //string reply = "";
         //mNetComClient.SendCommand("-PostEvent \"ConnectedToWMaze\" 0 0", ref reply);
         this.IP_address.Enabled = false;
         Close();
     }
     else
     {
         MessageBox.Show(this, "Connection to server failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }