lu
2025-04-19 b084bd77d01a94c8f0a2d20c86a1f45ba7c8a23c
DevApp/Gs.DevApp/DevFrm/FrmLogin.cs
@@ -1,5 +1,6 @@
using AutoUpdaterDotNET;
using DevExpress.XtraEditors;
using DevExpress.XtraRichEdit.Export.Rtf;
using Gs.DevApp.Entity;
using Gs.DevApp.Properties;
using Gs.DevApp.ToolBox;
@@ -18,18 +19,23 @@
{
    public partial class FrmLogin : XtraForm
    {
        private string _productName = "";
        private string _version = "未知";
        private string _strFont = "";
        private string _webApiUrl = "";
        public FrmLogin()
        {
            InitializeComponent();
            _productName = ConfigurationManager.AppSettings["ProductName"];
            _webApiUrl = ConfigurationManager.AppSettings["WebApiUrl"];
            if (ConfigurationManager.AppSettings["IsAutoUpdater"] == "1")
                _autoUpdate();
            _getFont();
            _getRemember();
            Text = lbVersion.Text = ConfigurationManager.AppSettings["ProductName"];
            btnLogin.Click += BtnLogin_Click;
            btnCancel.Click += BtnCancel_Click;
            lbVersion.Text = _productName+ ",版本(" + _version + ")" + ",使用字体(" + _strFont + ")"+",服务地址("+ _webApiUrl + ")";
        }
        private void BtnCancel_Click(object sender, EventArgs e)
@@ -114,10 +120,10 @@
        {
            try
            {
                string strFont = Settings.Default.fontSizeName;
                if (string.IsNullOrEmpty(strFont))
                _strFont = Settings.Default.fontSizeName;
                if (string.IsNullOrEmpty(_strFont))
                    return;
                string[] ary = strFont.Split(',');
                string[] ary = _strFont.Split(',');
                if (ary.Length < 2)
                    return;
                float _ft = float.Parse(ary[1]);
@@ -127,6 +133,7 @@
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = new System.Drawing.Font(ary[0], _ft);
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont = new System.Drawing.Font(ary[0], _ft);
                #endregion
            }
            catch (Exception)
            {
@@ -134,7 +141,7 @@
        }
        private void _autoUpdate()
        {
            var _version = ConfigurationManager.AppSettings["Version"];
            _version = ConfigurationManager.AppSettings["Version"];
            AutoUpdater.InstalledVersion = new Version(_version);
            AutoUpdater.Start(ConfigurationManager.AppSettings["AutoUpdaterXml"]);
            AutoUpdater.CheckForUpdateEvent += AutoUpdater_CheckForUpdateEvent;