GetWD_DataBaseBackup.aspx.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HNWD.Pregrant.WebService;
  8. using HNWD.Pregrant.Model;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.Common;
  12. using HNWD.Pregrant.BusinessLogic;
  13. using System.IO;
  14. namespace HNWD.Pregrant.WebService.MgrCSharp
  15. {
  16. public partial class GetWD_DataBaseBackup : PageBase
  17. {
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. string TempPath = this.MapPath(HttpContext.Current.Request.ApplicationPath.ToString());
  21. string TempFile = @"\DataBaseBK\WD_IPCALL" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".bak";
  22. if(Directory.Exists(TempPath))
  23. {
  24. Directory.CreateDirectory(TempPath);
  25. }
  26. new DataBaseBackUpDataAccess().BackUpDataBase(TempPath + TempFile);
  27. if(File.Exists(TempPath + TempFile))
  28. {
  29. Response.Redirect(TempFile);
  30. }
  31. }
  32. }
  33. }