Browse Source

fix: 第一次启动不提示错误信息

master
niushuai233 3 years ago
parent
commit
bf178b4575
  1. 2
      MainForm.Designer.cs
  2. 3
      MainForm.cs
  3. 1
      Util/CommonUtil.cs
  4. 6
      Util/SteamTwoFactorToken.cs

2
MainForm.Designer.cs generated

@ -185,7 +185,7 @@ namespace steam_token @@ -185,7 +185,7 @@ namespace steam_token
this.MinimizeBox = false;
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Steam令牌计算器";
this.Text = "Steam令牌计算器 v1.0";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.mainForm_FormClosed);
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();

3
MainForm.cs

@ -23,13 +23,12 @@ namespace steam_token @@ -23,13 +23,12 @@ namespace steam_token
ConfigUtil.Init(new Config());
InitializeComponent();
this.timer_time.Start();
while (!ConfigUtil.INIT_SUCCESS)
{
CheckConfig();
}
this.timer_time.Start();
// 新开一个线程去初始化数据
SteamGuardCalcThread.StartThread(this.label_guard, this.progressBar_refresh);
}

1
Util/CommonUtil.cs

@ -11,6 +11,7 @@ namespace steam_token.Util @@ -11,6 +11,7 @@ namespace steam_token.Util
public class CommonUtil
{
public static bool FIRST_ENABLE = true;
public static Config GetConfig()
{
return ConfigUtil.Read<Config>();

6
Util/SteamTwoFactorToken.cs

@ -47,7 +47,11 @@ namespace steam_token.Util @@ -47,7 +47,11 @@ namespace steam_token.Util
}
catch (Exception)
{
MessageBox.Show("shared_secret值校验失败, 请重新设置");
if (!CommonUtil.FIRST_ENABLE)
{
MessageBox.Show("shared_secret值校验失败, 请重新设置");
}
CommonUtil.FIRST_ENABLE = false;
return false;
}
}

Loading…
Cancel
Save