private void checkBox2_CheckedChanged(object sender, EventArgs e) { JsonConfig.AddConfigAndSave("autoStart", ckbAutostart.Checked.ToString()); if (ckbAutostart.Checked) { AutoStart.SetAutorunSetup(); } else { AutoStart.DeleteAutoSetup(); } }
public void InitConfig() { LogHelper.LogAction = new Action <string>(this.DisplayLog); this.ckbAutostart.CheckedChanged -= new System.EventHandler(this.checkBox2_CheckedChanged); if (JsonConfig.ReadConfigByName("autoStart").ToLower().Trim() == "true") { AutoStart.SetAutorunSetup(); ckbAutostart.Checked = true; } else { ckbAutostart.Checked = false; } this.ckbAutostart.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); if (JsonConfig.ReadConfigByName("autoInit").ToLower().Trim() == "true") { NewThreadStartYInhaiInit(); chkAutoInit.Checked = true; } else { chkAutoInit.Checked = false; } if (JsonConfig.ReadConfigByName("needlog").ToLower().Trim() == "true") { YBYinHaiBLL.NeedLog = true; chkLog.Checked = true; } else { chkLog.Checked = false; } YBYinHaiBLL.YiBaoPath = txtPath.Text = JsonConfig.ReadConfigByName("yibaoPath") ?? ""; RegDll(); StartServer(); }