Easy.COMMON/MyDataBackup.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace Easy.COMMON
{
public class MyDataBackup
{
// Fields
private string message;
private string Password;
private string ServerName;
private string UserName;
// Methods
public MyDataBackup() { }
public bool DbBackup(string[] _ConnectArray, string _PathStr)
{
bool CS0000;
string path = _PathStr;
Backup oBackup = new BackupClass();
SQLServer oSQLServer = new SQLServerClass();
try
{
oSQLServer.LoginSecure = false;
oSQLServer.Connect(_ConnectArray[0], _ConnectArray[2], _ConnectArray[3]);
oBackup.Action = SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database;
oBackup.Database = _ConnectArray[1];
oBackup.Files = path;
oBackup.BackupSetName = _ConnectArray[1];
oBackup.BackupSetDescription = "数据库备份";
oBackup.Initialize = true;
oBackup.SQLBackup(oSQLServer);
CS0000= true;
}
catch (Exception ex)
{
throw ex;
}
return CS0000;
}
public bool DbBackup(string[] _ConnectArray, string _PathStr);
public bool RestoreDB(string[] _ConnectArray, string strFileName);
public int SQLstrBackup(string[] _DBName, string _saveAway);
public int SQLstrRestore(string[] _DBName, string _saveAway, string _PathStrRe);
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。