private void btnBackup_Click(object sender, System.EventArgs e) { string text = StoreHelper.BackupData(); if (string.IsNullOrEmpty(text)) { this.ShowMsg("备份数据失败,可能是您的数据库服务器和web服务器不是同一台服务器", false); return; } string text2 = System.Web.HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/data/Backup/" + text); System.IO.FileInfo fileInfo = new System.IO.FileInfo(text2); if (StoreHelper.InserBackInfo(text, "1.2", fileInfo.Length)) { this.ShowMsg("备份数据成功", true); return; } System.IO.File.Delete(text2); this.ShowMsg("备份数据失败,可能是同时备份的人太多,请重试", false); }
private void btnBackup_Click(object sender, EventArgs e) { string text = StoreHelper.BackupData(); if (!string.IsNullOrEmpty(text)) { string text2 = HttpContext.Current.Request.MapPath("/Storage/data/Backup/" + text); FileInfo fileInfo = new FileInfo(text2); if (StoreHelper.InserBackInfo(text, HiContext.Current.Config.Version, fileInfo.Length)) { this.ShowMsg("备份数据成功", true); } else { File.Delete(text2); this.ShowMsg("备份数据失败,可能是同时备份的人太多,请重试", false); } } else { this.ShowMsg("备份数据失败,可能是您的数据库服务器和web服务器不是同一台服务器", false); } }
private void btnBackup_Click(object sender, System.EventArgs e) { string str = StoreHelper.BackupData(); if (!string.IsNullOrEmpty(str)) { string fileName = System.Web.HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/data/Backup/" + str); System.IO.FileInfo info = new System.IO.FileInfo(fileName); if (StoreHelper.InserBackInfo(str, "2.2", info.Length)) { this.ShowMsg("备份数据成功", true); } else { System.IO.File.Delete(fileName); this.ShowMsg("备份数据失败,可能是同时备份的人太多,请重试", false); } } else { this.ShowMsg("备份数据失败,可能是您的数据库服务器和web服务器不是同一台服务器", false); } }