示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      path  = System.AppDomain.CurrentDomain.BaseDirectory;
            BackUpModel model = new BackUpModel();

            model.destDBFileName   = @"DataBase\SHOEDB.db";
            model.backupDBFileName = @"BuckUp\SHOEDB.db";
            BackUpDateBase myBackUpDateBase = new BackUpDateBase();

            myBackUpDateBase.Initializae(model);
            myBackUpDateBase.BackupDB();
            MessageBox.Show("OK");
        }
示例#2
0
 //数据备份
 private void t_btn_DataBackup_Click(object sender, EventArgs e)
 {
     try
     {
         string      path  = System.AppDomain.CurrentDomain.BaseDirectory;
         BackUpModel model = new BackUpModel();
         model.destDBFileName   = path + @"DataBase\SHOEDB.db";
         model.backupDBFileName = path + string.Format(@"BuckUp\SHOEDB_{0}.db", DateTime.Now.ToShortDateString());
         BackUpDateBase myBackUpDateBase = new BackUpDateBase();
         myBackUpDateBase.Initializae(model);
         myBackUpDateBase.BackupDB();
         this.Info("备份成功!");
     }
     catch (Exception ex)
     {
         this.Warning(ex.Message);
     }
 }