Exemple #1
0
        protected override void InitForm()
        {
            formCode = "Login";
            Icon icon = this.Icon;

            btnConnect.Visible = false;
            base.InitForm();
            lbTitlte.Text      = this.Text;
            Icon               = icon;
            btnConnect.Visible = SystemInfo.DBType == 1;
            btnConnect.Enabled = btnConnect.Visible;
            appLastWriteTime   = Pub.GetFileTime(Application.ExecutablePath);
            SystemInfo.ConnStr = GetConnStr();
            if ((SystemInfo.DBType == 1) && (DBServerInfo.ServerName == ""))
            {
                if (ShowDBConnect())
                {
                    return;
                }
            }

            SystemInfo.ConnStrReport = GetConnStrReport();

            LoadData();

            IsRePassword    = SystemInfo.ini.ReadIni("Public", "IsRePassword", false);
            RePassword      = SystemInfo.ini.ReadIni("Public", "RePassword", "");
            chkPass.Checked = IsRePassword;
            if (IsRePassword)
            {
                txtPass.Text = Pub.GetOprtDecrypt(RePassword);
            }
            if (SystemInfo.LangName == "CHS" || SystemInfo.LangName == "CHT")
            {
                lblTitle.Font   = new Font(Font.Name, 20, FontStyle.Bold);
                lblVersion.Font = new Font(Font.Name, 10, FontStyle.Bold);
            }
            else
            {
                lblTitle.Font   = new Font(Font.Name, 16, FontStyle.Bold);
                lblVersion.Font = new Font(Font.Name, 10, FontStyle.Bold);
            }

            lblTitle.Text = SystemInfo.AppTitle;
            label1.Font   = lblTitle.Font;
            label1.Text   = lblTitle.Text;
            float size = 20;

            while (label1.Width > lblTitle.Width)
            {
                label1.Font = new Font(Font.Name, size, FontStyle.Bold);
                size        = size - (float)0.5;
            }
            lblTitle.Font        = label1.Font;
            lblVersion.Text      = SystemInfo.AppVersion;
            lblHint.ForeColor    = Color.Blue;
            lblTitle.ForeColor   = Color.Red;
            lblVersion.ForeColor = Color.Blue;
        }
Exemple #2
0
 private void CompareFileTime(string fileName)
 {
     if (File.Exists(fileName))
     {
         DateTime dtTime = Pub.GetFileTime(fileName);
         if (dtTime > appLastWriteTime)
         {
             appLastWriteTime = dtTime;
         }
     }
 }
Exemple #3
0
        protected override void InitForm()
        {
            formCode = "Login";
            base.InitForm();
            appLastWriteTime   = Pub.GetFileTime(Application.ExecutablePath);
            SystemInfo.ConnStr = GetConnStrSystem();
            if ((SystemInfo.DBType == 1) && (DBServerInfo.ServerName == ""))
            {
                if (ShowDBConnect())
                {
                    return;
                }
            }
            LoadAccount();
            IsRePassword    = (SystemInfo.ini.ReadIni("Public", "IsRePassword", "") == "1");
            RePassword      = SystemInfo.ini.ReadIni("Public", "RePassword", "");
            chkPass.Checked = IsRePassword;
            if (SystemInfo.LangName == "CHS" || SystemInfo.LangName == "CHT")
            {
                lblTitle.Font   = new Font(Font.Name, 20, FontStyle.Bold);
                lblVersion.Font = new Font(Font.Name, 10, FontStyle.Bold);
            }
            else
            {
                lblTitle.Font   = new Font(Font.Name, 16, FontStyle.Bold);
                lblVersion.Font = new Font(Font.Name, 10, FontStyle.Bold);
            }
            label4.Font     = lblTitle.Font;
            lblTitle.Text   = SystemInfo.AppTitle;
            lblVersion.Text = SystemInfo.AppVersion;
            label4.Text     = lblTitle.Text;
            float size = 20;

            while (label4.Width > lblTitle.Width)
            {
                label4.Font = new Font(Font.Name, size, FontStyle.Bold);
                size        = size - (float)0.5;
            }
            lblTitle.Font = label4.Font;
            if (SystemInfo.DBType == 2)
            {
                btnConnect.Visible = false;
            }
            btnConnect.Enabled = btnConnect.Visible;
        }