public LoginForm() { InitializeComponent(); //连接Sqlite数据库 if (!SQLiteControl.ConnectToDatabase(@"./DataBase/database.sqlite")) { XtraMessageBoxArgs args = ControlHelper.XtraMessageBoxArgs("消息", "连接数据库失败", new DialogResult[] { DialogResult.Yes }); XtraMessageBox.Show(args); Application.Exit(); } account_textEdit.Focus(); //每次登录前Copy一份DB FileInfo file = new FileInfo(@"./DataBase/database.sqlite"); if (!File.Exists(@"./DataBase/" + DateTime.Today.ToString("yyyy-MM-dd") + ".sqlite")) { file = file.CopyTo(@"./DataBase/" + DateTime.Today.ToString("yyyy-MM-dd") + ".sqlite"); } //解密文件 //else //{ // file = new FileInfo(@"./DataBase/" + DateTime.Today.ToString("yyyy-MM-dd") + ".sqlite"); // file.Decrypt(); //} PreLoad(); login_simpleButton.Focus(); }