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 ......
asp.net遍历HashTable需要用到DictionaryEntry Object,asp.net遍历HashTable,可以通过如下两种方法来实现,
方法一:
foreach (System.Collections.DictionaryEntry objDE in objHasTab)
{
Console.WriteLine(objDE.Key.ToString());
Console.WriteLine(objDE.Value.ToString ......
在以前的ASP时候,当请求一个*.asp页面文件的时候,这个HTTP请求首先会被一个名为inetinfo.exe进程所截获,这个进程实际上就是www服务。截获之后它会将这个请求转交给asp.dll进程,这个进程就会解释这个asp页面,然后将解释后的数据流返回给客户端浏览器。其实ASP.DLL是一个依附在IIS的ISAPI文件,它负责了对诸如ASP文件,A ......
以blog系统为例,一个简单的blog系统模型包括:
1.发表一篇新的blog
2.显示一篇blog
3.修改一篇blog
4.删除一篇blog
ASP.net MVC会是这样的URL规划:
*. http://www.gaotianpu.com/blog/create,创建
get方法给用户展示一个html表单,供用户提交数据
post方法接受用户提交的数据,插入到db
*. http://www.gaotianpu. ......
ASP.NET处理程序和模块
ASP.NET HTTP 处理程序(Handler)是响应对 ASP.NET Web 应用程序的请求而运行的程序
如处理 *.aspx文件的ASP.NET处理程序 ......