Esempio n. 1
0
        ///注册配置
        private void barBtn_authority_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            RegForm dlg = new RegForm();

            dlg.ShowDialog();
        }
Esempio n. 2
0
        public void BeginCheck()
        {
            string AppRegFilePath = Application.StartupPath + "\\AppRun.dll";

            #region  //测试版先不连接地址院的校验服务器


            //if(!MyMethod.CheckFileExists(AppRegFilePath))
            //{
            //    //第一次运行,由于没有注册文件,所以先到服务器上拉取一下,比较慢,出进度条
            //    curProgress = new ProgressForm("正在为第一次运行做准备……");
            //    curProgress.Show(parentForm);
            //    //parentForm.Enabled = false;
            //}


            ////先连接服务器,调用更新文件
            //DownLoadRegFile opUpdateRegFile = new DownLoadRegFile();
            //opUpdateRegFile.BeginOp();

            //if (curProgress != null)
            //{
            //    curProgress.Close();
            //    //parentForm.Enabled = true;
            //}

            #endregion

            //如果没有注册文件,要检测是否是第一次安装
            if (!MyMethod.CheckFileExists(AppRegFilePath))
            {   //获取数据库中的标识
                if (GetAccessRegInfo(opDB))
                {
                    //如果第一次安装,密码存储应为null
                    if (dt_AcessReg.Rows.Count > 0)
                    {
                        string TempValue = dt_AcessReg.Rows[0]["psw"].ToString();
                        if (string.IsNullOrEmpty(TempValue))
                        {
                            //确认为第一次安装,启动相关模块
                            RegForm form = new RegForm(opDB);
                            ////默认一个月
                            ////form.text_RegDW.Text = "培训专用";
                            ////form.date_UseDataLimite.Value = "2015-11-10".ConvertDate("yyyy-MM-dd");
                            ////form.btn_Reg_Click(null, null);
                            ////手工注册使用
                            form.TopMost = true;
                            form.ShowDialog(parentForm);
                            form.Dispose();
                            string tempValue = DateTime.Now.ToString("yyyy-MM-dd");
                            dt_AcessReg.Rows[0]["psw"] = MyMethod.GetEecryptStr(tempValue);
                            SaveAccessRegInfo();
                        }
                    }
                }
            }

            BackgroundWorker back_CheckReg = new BackgroundWorker();
            back_CheckReg.WorkerSupportsCancellation = true;
            back_CheckReg.DoWork             += back_CheckReg_DoWork;
            back_CheckReg.RunWorkerCompleted += back_CheckReg_RunWorkerCompleted;
            back_CheckReg.RunWorkerAsync();
        }
Esempio n. 3
0
 private void btnReg_Click(object sender, EventArgs e)
 {
     regForm.ShowDialog();
 }