protected void Button11_Click(object sender, EventArgs e)//备份
{ Bei_Fen_data(); }
protected void Bei_Fen_data()//备份
{
string DateTimes = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() + System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();
if (!File.Exists(Server.MapPath(@"~/DataBasc/" + "备份" + DateTimes + ".aspx")))
{
File.Copy(Server.MapPath(@"~/Data/So.aspx"), Server.MapPath(@"~/DataBasc/" + "备份" + DateTimes + ".aspx"));
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "tixin", "alert('备份成功。')", true);
}
else { System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "tixin", "alert('备份失败?')", true); }
}
protected void Button12_Click(object sender, EventArgs e)//还原
{
File.Copy(Server.MapPath(@"~/DataBasc/" + DropDownList8.Text), Server.MapPath(@"~/Data/So.aspx"), true);
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "tixin", "alert('恢复成功。')", true);
}