asp.net(C#) 数据库备份还原 源码
Backup.aspx
protected void Button1_Click(object sender, EventArgs e)
{
string path = Server.MapPath("") + @"\Backup";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
try
{
path = Convert.ToString(Hst.DBUtility.DbHelperSQL.GetSingle("p_DataBaseBack"));
LabelMessage.Text = "备份成功; 文件存放路径在:" + path;
}
catch
{
LabelMessage.Text = "备份失败!请联系管理员";
}
}
DataBack.aspx
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Hst.DBUtility;
public partial class SysManager_DataBack : System.Web.UI.Page
{
const string FilePath = "E:\\Backup\\";
int a = 1;
Hst.SysManage.FileControl fc = new Hst.SysManage.FileControl();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
 
相关文档:
1 类似xmlns=""的文件
示例XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<WebSrvMessage xmlns="http://www.lenoval.com/">
<version>1.0</version>
<DataContent>
<DateTag>2010-5-17</DateTag>
</DataCont ......
在2003系统下,按照在IIS6中网站右键属性-主目录-配置-在通配符应用程序映射-插入设置添加统配符,可执行文件选择C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll 注意“确认文件是否存在”这个选项不要选上
2 站点中引入UrlRewrting.dll
3 Web.config配置修改如下:
<RewriterConfig& ......
系统类
Type类,Object类,String类, Array类,Console类, Exception类,GC类, MarshalByRefObject类, Math类。
DateTime结构,Guid 结构,
ICloneable接口,IComparable接口,IConvertible接口, IDisposable类,
集合类
ICollection接口,IComparer接口,IDictionary接口。IDictionaryEnume ......
页面加载顺序如下:
Page.Init
Page.Load
Textbox.TextChanged
Button.Click
Page.PreRender
Page.Unload
在Page.Unload之前,页面就呈现出来了.
page.init只是在页面第一次载入的时候执行,当页面postback后从page.load开始执行.
e.g
<%@ Page Language="C#" AutoEventWireup="true" CodeBe ......
1.<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
Vs2005红色了,提示找不到该文件
于是改为.<script src="/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
结果红色没有了,但是编译时报错,找不到该文件
结论:<script src="Script ......