| | |
| | | txtUser.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(txtPwd.Text.Trim())) |
| | | { |
| | | MsgHelper.Warning("密码不能为空!"); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | DialogResult = DialogResult.Cancel; |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | 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) |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | #region 自动更新 |
| | | private void _autoUpdate() |
| | | { |
| | | _version = ConfigurationManager.AppSettings["Version"]; |
| | |
| | | AutoUpdater.Start(ConfigurationManager.AppSettings["AutoUpdaterXml"]); |
| | | AutoUpdater.CheckForUpdateEvent += AutoUpdater_CheckForUpdateEvent; |
| | | } |
| | | |
| | | private void AutoUpdater_CheckForUpdateEvent(UpdateInfoEventArgs args) |
| | | { |
| | | if (args == null || string.IsNullOrEmpty(args.DownloadURL)) |
| | |
| | | Application.Exit(); |
| | | return; |
| | | } |
| | | |
| | | if (!args.IsUpdateAvailable) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var _strMsg = |
| | | string.Format( |
| | | $@"有新版本 {args.CurrentVersion} 可用,您使用的是 {args.InstalledVersion}版本,这是必需的更新,按“是(Y)”开始更新应用程序。"); |
| | |
| | | Application.Exit(); |
| | | return; |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (AutoUpdater.DownloadUpdate(args)) |
| | |
| | | config.Save(ConfigurationSaveMode.Modified); |
| | | ConfigurationManager.RefreshSection("appSettings"); |
| | | } |
| | | |
| | | Application.Exit(); |
| | | } |
| | | else |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取mac |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private string GetMacAddress() |
| | | { |
| | | System.Text.StringBuilder sb = new System.Text.StringBuilder(); |