/// <summary> /// 初始化 /// </summary> public void Init() { if (!Util.VerifyUser(ConfigurationManager.AppSettings["IsLogin"])) { // 非法软件操作 HandyControl.Controls.MessageBox.Error("非法软件操作!!!"); this.Close(); return; } Util.CreateKeyFile(); new Thread(new ThreadStart(() => { DbInit init = new DbInit(); init.initTable(); Thread.Sleep(2000); this.Dispatcher?.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() => { LoginWindow loginWindow = new LoginWindow(); loginWindow.Show(); this.Close(); })); })) { IsBackground = true }.Start(); }