.net备份access数据库方法
String FullFileName = Server.MapPath("文件路径");
FileInfo DownloadFile = new FileInfo(FullFileName);
if (File.Exists(DownloadFile.FullName)) {
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
File.Delete(DownloadFile.FullName);
Response.End();
}
else {
Point.Utility.MessageHandler.MessageBox("提示:该备份文件已经存在,请重新备份!", Utility.MessageType.PathURL, "bakdb.aspx");//自己封装的提示信息,用户自己response.write("<script>alert('');</script>")
}