欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

vb.net數(shù)據(jù)庫(kù)備份,如何備份vbios

VB.NET備份SQL數(shù)據(jù)庫(kù)

using System;

10年積累的成都網(wǎng)站制作、做網(wǎng)站經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有莫力達(dá)免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

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.IO;

using System.Text;

using _5dRss.Const;

using _5dRss.lib.Data.Tool;

public partial class admin_admin_dbmanage : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

//生成備份文件列表

ListBackupFiles();

if (!Page.IsPostBack)

{

Showmsg.Visible = false;

//數(shù)據(jù)庫(kù)路徑

lilDBPath.Text = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

//新建一個(gè) FileInfo 對(duì)象,并獲得數(shù)據(jù)庫(kù)文件的大小,然后轉(zhuǎn)換單位為KB

FileInfo myFileInfo = new FileInfo(lilDBPath.Text);

lilDBSize.Text = Convert.ToString(myFileInfo.Length/1024) + " KB";

//如果兩個(gè)參數(shù)都不為空,則繼續(xù)執(zhí)行

if (Request.QueryString["cmd"] != null Request.QueryString["source"] != null)

{

//備份數(shù)據(jù)庫(kù)原文件名

string sourceFileName = Request.QueryString["source"];

//如果 cmd 參數(shù)為 DelFile

if (Request.QueryString["cmd"].Equals("DelFile"))

{

//刪除備份數(shù)據(jù)庫(kù)文件

File.Delete(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + sourceFileName);

//刷新備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'刪除備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

//如果 cmd 參數(shù)為 Restore

if (Request.QueryString["cmd"].Equals("Restore"))

{

//用備份文件覆蓋原文件

File.Copy(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + sourceFileName, HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"], true);

//刷新備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'還原備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

}

}

}

protected void lnkbtnCompactDB_Click(object sender, EventArgs e)

{

//壓縮修復(fù)數(shù)據(jù)庫(kù)

AccessDBtool.CompactAccessDB(SysConfig.ConnectionString, HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"]);

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'壓縮修復(fù)數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

protected void lnkbtnBackupDB_Click(object sender, EventArgs e)

{

string sourceFileName = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

string destFileName = HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + "Backup_";

destFileName += DateTime.Now.ToString("yyyyMMddHHmmss");

destFileName += ".mbk";

//將數(shù)據(jù)庫(kù)文件Copy到Backup目錄,如果有重名文件就覆蓋原文件

File.Copy(sourceFileName, destFileName, true);

//生成備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

/// summary

/// 生成備份文件列表

/// /summary

/// returns文件列表,文件詳細(xì)信息及操作選項(xiàng)的HTML代碼/returns

public void ListBackupFiles()

{

//如果目錄不存在則創(chuàng)建次目錄

if (!Directory.Exists(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\"))

Directory.CreateDirectory(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\");

DirectoryInfo mydir = new DirectoryInfo(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\");

StringBuilder sb = new StringBuilder();

foreach (FileInfo f in mydir.GetFiles())

{

sb.Append("a href='backup/" + f.Name + "' target='_blank'img border='0' src='images/mdb.gif' style='margin:4px 3px -3px 0px'/" + f.Name + "/a a href='?cmd=DelFilesource=" + f.Name + "' title='刪除備份文件'刪除/a | a href='?cmd=Restoresource=" + f.Name + "' title='刪除備份文件'還原數(shù)據(jù)庫(kù)/a | " + f.Length/1024 + " KB | " + f.CreationTime + "br /");

}

lilBackupFileList.Text = sb.ToString();

}

}

把下面這句換成你的數(shù)據(jù)庫(kù)地址:

//數(shù)據(jù)庫(kù)路徑

// lilDBPath.Text = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

vb.net 怎么備份當(dāng)前正在連接的數(shù)據(jù)庫(kù)(sql)

用BACKUP database

例:將“country”數(shù)據(jù)庫(kù)完全備份到“qq”

USE country

BACKUP database country TO qq

GO

vb.net中備份SQL數(shù)據(jù)庫(kù)問(wèn)題

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.IO;

using System.Text;

using _5dRss.Const;

using _5dRss.lib.Data.Tool;

public partial class admin_admin_dbmanage : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

//生成備份文件列表

ListBackupFiles();

if (!Page.IsPostBack)

{

Showmsg.Visible = false;

//數(shù)據(jù)庫(kù)路徑

lilDBPath.Text = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

//新建一個(gè) FileInfo 對(duì)象,并獲得數(shù)據(jù)庫(kù)文件的大小,然后轉(zhuǎn)換單位為KB

FileInfo myFileInfo = new FileInfo(lilDBPath.Text);

lilDBSize.Text = Convert.ToString(myFileInfo.Length/1024) + " KB";

//如果兩個(gè)參數(shù)都不為空,則繼續(xù)執(zhí)行

if (Request.QueryString["cmd"] != null Request.QueryString["source"] != null)

{

//備份數(shù)據(jù)庫(kù)原文件名

string sourceFileName = Request.QueryString["source"];

//如果 cmd 參數(shù)為 DelFile

if (Request.QueryString["cmd"].Equals("DelFile"))

{

//刪除備份數(shù)據(jù)庫(kù)文件

File.Delete(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + sourceFileName);

//刷新備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'刪除備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

//如果 cmd 參數(shù)為 Restore

if (Request.QueryString["cmd"].Equals("Restore"))

{

//用備份文件覆蓋原文件

File.Copy(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + sourceFileName, HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"], true);

//刷新備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'還原備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

}

}

}

protected void lnkbtnCompactDB_Click(object sender, EventArgs e)

{

//壓縮修復(fù)數(shù)據(jù)庫(kù)

AccessDBtool.CompactAccessDB(SysConfig.ConnectionString, HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"]);

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'壓縮修復(fù)數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

protected void lnkbtnBackupDB_Click(object sender, EventArgs e)

{

string sourceFileName = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

string destFileName = HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\" + "Backup_";

destFileName += DateTime.Now.ToString("yyyyMMddHHmmss");

destFileName += ".mbk";

//將數(shù)據(jù)庫(kù)文件Copy到Backup目錄,如果有重名文件就覆蓋原文件

File.Copy(sourceFileName, destFileName, true);

//生成備份文件列表

ListBackupFiles();

Showmsg.Visible = true;

Showmsg.Text = "div align='center' style='margin-bottom:8px;'img src='images/aL.gif' style='margin-bottom:-6px;'/span class='alertTxt'備份數(shù)據(jù)庫(kù)成功!/spanimg src='images/aR.gif' style='margin-bottom:-6px;'//div";

}

/// summary

/// 生成備份文件列表

/// /summary

/// returns文件列表,文件詳細(xì)信息及操作選項(xiàng)的HTML代碼/returns

public void ListBackupFiles()

{

//如果目錄不存在則創(chuàng)建次目錄

if (!Directory.Exists(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\"))

Directory.CreateDirectory(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\");

DirectoryInfo mydir = new DirectoryInfo(HttpContext.Current.Request.PhysicalApplicationPath + "Backup\\");

StringBuilder sb = new StringBuilder();

foreach (FileInfo f in mydir.GetFiles())

{

sb.Append("a href='backup/" + f.Name + "' target='_blank'img border='0' src='images/mdb.gif' style='margin:4px 3px -3px 0px'/" + f.Name + "/a a href='?cmd=DelFilesource=" + f.Name + "' title='刪除備份文件'刪除/a | a href='?cmd=Restoresource=" + f.Name + "' title='刪除備份文件'還原數(shù)據(jù)庫(kù)/a | " + f.Length/1024 + " KB | " + f.CreationTime + "br /");

}

lilBackupFileList.Text = sb.ToString();

}

}

把下面這句換成你的數(shù)據(jù)庫(kù)地址:

//數(shù)據(jù)庫(kù)路徑

// lilDBPath.Text = HttpContext.Current.Request.PhysicalApplicationPath + "App_Data\\" + ConfigurationSettings.AppSettings["DBFile"];

vb.net怎么實(shí)現(xiàn)數(shù)據(jù)庫(kù)的復(fù)制備份

Access 數(shù)據(jù)庫(kù)備份時(shí).需要關(guān)閉數(shù)據(jù)庫(kù)的連接后才能進(jìn)行備份操作.也就是復(fù)制操作.

當(dāng)前標(biāo)題:vb.net數(shù)據(jù)庫(kù)備份,如何備份vbios
瀏覽地址:http://chinadenli.net/article30/phjspo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站App開發(fā)、標(biāo)簽優(yōu)化關(guān)鍵詞優(yōu)化、網(wǎng)站設(shè)計(jì)定制開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)
老司机精品国产在线视频| 丝袜破了有美女肉体免费观看 | 在线免费观看黄色美女| 国产成人亚洲精品青草天美 | 国产又粗又硬又长又爽的剧情| 精品国产一区二区欧美| 日韩成人午夜福利免费视频 | 日韩欧美91在线视频| 中文字幕亚洲视频一区二区| 欧美一级黄片欧美精品| 在线日本不卡一区二区| 91亚洲精品国产一区| 日韩中文字幕在线不卡一区| 色综合伊人天天综合网中文| 欧美三级大黄片免费看| 在线免费观看一二区视频| 深夜日本福利在线观看| 福利视频一区二区在线| 日韩精品中文字幕在线视频| 国产精品大秀视频日韩精品| 色丁香一区二区黑人巨大| 日本高清不卡在线一区| 少妇人妻中出中文字幕| 婷婷色香五月综合激激情| 中字幕一区二区三区久久蜜桃| 亚洲欧美日韩在线看片 | 欧美性高清一区二区三区视频| 国产91色综合久久高清| 91偷拍与自偷拍精品| 国产一区麻豆水好多高潮| 亚洲av日韩一区二区三区四区| 久久91精品国产亚洲| 激情五月天深爱丁香婷婷| 伊人久久五月天综合网| 丰满的人妻一区二区三区| 中文字幕免费观看亚洲视频 | 又色又爽又无遮挡的视频| 欧美黑人在线一区二区| 男女午夜福利院在线观看| 一区二区三区亚洲国产| 91日韩欧美国产视频|