Exemple #1
0
        private void ScanSyncDevice()
        {
            var devices = Utils.GetUsbDevices();

            if (devices.Any())
            {
                var d = Utils.GetInitializedUsb(devices);
                if (d == null)
                {
                    var serverType = Utils.GetCurrentServerType();
                    if (serverType == 1)
                    {
                        MessageBox.Show("您的 USB 设备没有在客户端电脑进行过初始化,将无法在服务器端使用");
                    }
                    else if (serverType == 2)
                    {
                        Hide();
                        MessageBox.Show("您的 USB 设备还没有经过初始化,请先初始化您的设备");
                        initFrm = FrmDeploy.GetForm(this);
                        initFrm.Show();
                    }
                }
            }
            else
            {
                MessageBox.Show("没有找到移动存储设备(USB),请检查您的设备是否连接到这台电脑");
                this.Close();
            }
        }
Exemple #2
0
        public static FrmDeploy GetForm(Form main)
        {
            if (instance == null)
            {
                instance = new FrmDeploy(main);
            }

            return(instance);
        }