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

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

作者:  來源:  發(fā)布時間:2011-6-15 15:18:23  點擊:
</font>"
end if
'SQL Server 數(shù)據(jù)庫的備份與恢復(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>沒有輸入數(shù)據(jù)庫名稱!</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ù)據(jù)庫時進行!
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>請選擇備份或恢復(fù)!</font>"
end if
end if
end if
%></td>
</tr>
</table>
</body>
</html>
首頁 上一頁 [6] [7] [8]  下一頁 尾頁

相關(guān)軟件

相關(guān)文章

文章評論

欄目導(dǎo)航

本類熱門

本類推薦

本站熱門

本站推薦

軟件按字母排列: 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