當(dāng)前位置:首頁(yè)文章首頁(yè) IT學(xué)院 IT技術(shù)

比較全的SQL注入相關(guān)的命令分享

作者:  來(lái)源:  發(fā)布時(shí)間:2011-6-15 15:18:23  點(diǎn)擊:
</font>"
end if
'SQL Server 數(shù)據(jù)庫(kù)的備份與恢復(fù)!
if request("action")="backupdatabase" Then
dim sqlserver,sqlname,sqlpassword,sqlLoginTimeout,databasename,bak_file,act
sqlserver = trim(request("sqlserver"))
sqlname = trim(request("sqlname"))
sqlpassword =trim(request("sqlpassword"))
sqlLoginTimeout = 15
databasename = trim(request("databasename"))
bak_file = trim(request("bak_file"))
bak_file = replace(bak_file,"$1",databasename)
act = lcase(request("act"))
if databasename = "" then
response.write "<font color=#ff0000>沒(méi)有輸入數(shù)據(jù)庫(kù)名稱(chēng)!</font>"
else
if act = "backup" then
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set bak = Server.CreateObject("SQLDMO.Backup")
bak.Database=databasename
bak.Devices=Files
bak.Action   = 0
bak.Initialize   = 1
'bak.Replace   = True
bak.Files=bak_file
bak.SQLBackup srv
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
Response.write "<font color=green>備份成功!</font>"
elseif act="restore" then
'恢復(fù)時(shí)要在沒(méi)有使用數(shù)據(jù)庫(kù)時(shí)進(jìn)行!
Set srv=Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = sqlLoginTimeout
srv.Connect sqlserver,sqlname, sqlpassword
Set rest=Server.CreateObject("SQLDMO.Restore")
rest.Action=0 ' full db restore
rest.Database=databasename
rest.Devices=Files
rest.Files=bak_file
rest.ReplaceDatabase=True 'Force restore over existing database
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
rest.SQLRestore srv
Response.write "<font color=green>恢復(fù)成功!</font>"
else
Response.write "<font color=red>請(qǐng)選擇備份或恢復(fù)!</font>"
end if
end if
end if
%></td>
</tr>
</table>
</body>
</html>

相關(guān)軟件

相關(guān)文章

文章評(píng)論

欄目導(dǎo)航

本類(lèi)熱門(mén)

本類(lèi)推薦

本站熱門(mén)

本站推薦

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z