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)
 
相关文档:
using System;
using System.Data;
using System.Configuration;
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.IO;
using System.Xml;
using System.Text; ......
在2003系统下,按照在IIS6中网站右键属性-主目录-配置-在通配符应用程序映射-插入设置添加统配符,可执行文件选择C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll 注意“确认文件是否存在”这个选项不要选上
2 站点中引入UrlRewrting.dll
3 Web.config配置修改如下:
<RewriterConfig& ......
画面:
<asp:HiddenField ID="hfdXuHao" runat="server" />
<asp:TreeView ID="tvMenu" runat="server" CssClass="tvStyle" EnableClientScript="false"
& ......
本篇文章介绍了在ASP.Net 2.0如何做窗体身份验证,并且讲解了IIS和ASP.Net2.0窗体身份验证机制是如何结合在一起的。我们还会详细讲解一下2.0中关于窗体身份验证的一个类:FormsAuthenticationModule。
l 综述
当某一个用户使用用户名成功登陆网站时,FormsAuthenticatio ......
Unix时间戳最小单位是秒,开始时间为格林威治标准时间1970-01-01 00:00:00
ConvertIntDateTime方法的基本思路是通过获取本地时区表示Unixk开始时间,加上Unix时间值(即过去的秒数).
ConvertDateTimeInt方法的基本思路是通过刻度数差,再把刻度数转换为秒数,当然要说明的是,我这里返回的是double类型,意义上并非是真 ......