private void FormMain_Load(object sender, EventArgs e)
        {
            this.Invoke(new Action(() => {
                // 显示登录框
                FormLogin formTemp = new FormLogin();
                formTemp.ShowDialog();
                formTemp.Dispose();

                // 判断是否登录成功
                if (ClassStatic.isLogined)
                {
                    deviceList      = new ControlDeviceList();
                    softwareSetting = new ControlSoftwareSetting();
                    // 显示托盘图标
                    notifyIcon1.Visible = true;
                    // 设置在线状态
                    ClassStatic.onlineStatus = 0;
                    // 设置窗体在线状态
                    statusOnlineControl1.Status = 0;
                    // 设置窗体中的头像为用户选中头像
                    portraitBox1.Portrait = ClassStatic.portraitPid;
                    // 初始化设备列表
                    deviceList.InitializeDeviceList();
                    // 将设备列表添加到显示容器
                    panel1.Controls.Add(deviceList);

                    ShortcutkeyHandRegister();
                    // 显示本窗体
                    this.Show();
                }
                else
                {
                    this.Dispose();
                    this.Close();
                }
            }));
        }
 public FormLogin()
 {
     formLogin = this;
     InitializeComponent();
     this.StartPosition = FormStartPosition.CenterScreen;
 }