Пример #1
0
 private void Cmd_get_info_bt_Click(object sender, EventArgs e)
 {
     if (forms_GetInfo == null)
     {
         forms_GetInfo            = new Forms.GetInfo();
         forms_GetInfo.serverMain = serverMain;
         forms_GetInfo.Show();
     }
     else if (forms_GetInfo.IsDisposed)
     {
         forms_GetInfo            = new Forms.GetInfo();
         forms_GetInfo.serverMain = serverMain;
         forms_GetInfo.Show();
     }
     else
     {
         forms_GetInfo.Activate();
     }
 }
Пример #2
0
        private void Cmd_stop_server_bt_Click(object sender, EventArgs e)
        {
            if (serverMain != null)
            {
                serverMain.Stop();
            }
            if (serverPing != null)
            {
                serverPing.Stop();
            }
            if (serverCapture != null)
            {
                serverCapture.Stop();
            }
            serverMain    = null;
            serverPing    = null;
            serverCapture = null;
            Cmd_stop_server_bt.Enabled  = false;
            Cmd_start_server_bt.Enabled = true;
            isConnected                   = false;
            Cap_raw_tx.Text               = "停止";
            Cmd_panel.Enabled             = false;
            Cap_start_capture_bt.Enabled  = false;
            Cap_stop_capture_bt.Enabled   = false;
            Cap_send_mouse_ckb.Checked    = false;
            Cap_keyinput_send_chb.Checked = false;
            Cap_mouse_X_tx.Text           = "";
            Cap_mouse_Y_tx.Text           = "";

            if (forms_SendMsg != null)
            {
                if (!forms_SendMsg.IsDisposed)
                {
                    forms_SendMsg.Dispose();
                }
            }
            if (forms_ScreenShot != null)
            {
                if (!forms_ScreenShot.IsDisposed)
                {
                    forms_ScreenShot.Dispose();
                }
            }
            if (forms_KeyboardLogs != null)
            {
                if (!forms_KeyboardLogs.IsDisposed)
                {
                    forms_KeyboardLogs.Dispose();
                }
            }
            if (forms_CommandForm != null)
            {
                if (!forms_CommandForm.IsDisposed)
                {
                    forms_CommandForm.Dispose();
                }
            }
            if (forms_PowerSettings != null)
            {
                if (!forms_PowerSettings.IsDisposed)
                {
                    forms_PowerSettings.Dispose();
                }
            }
            if (forms_MainExplorer != null)
            {
                if (!forms_MainExplorer.IsDisposed)
                {
                    forms_MainExplorer.Dispose();
                }
            }
            if (forms_TaskManeger != null)
            {
                if (!forms_TaskManeger.IsDisposed)
                {
                    forms_TaskManeger.Dispose();
                }
            }
            if (forms_SendImage != null)
            {
                if (!forms_SendImage.IsDisposed)
                {
                    forms_SendImage.Dispose();
                }
            }
            forms_GetInfo = null;
            GC.Collect();
        }