?? admin_upfiles.asp
字號:
<!-- #include file="../conn.asp" -->
<!--#include file="../inc/config.asp"-->
<!-- #include file="session.asp" -->
<html>
<head>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
id=trim(request("checked"))
If ID="" Then
ErrCodes = ErrCodes & "<li> 您至少需要選擇一條紀錄!</li><br>"
FoundErr=True
End If
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:window.close()")
else
viewArray=Split(ID, ",")
Num = UBound(viewArray)
For i=0 To Num
set rsfile=server.createobject("adodb.recordset")
if IsSqlDataBase = 2 then
strSQL ="select fileurl_name,fileurl_path from filetest where ID ="&viewArray(i)&""
else
strSQL ="select fileurl_name,fileurl_path from [filetest] where ID ="&viewArray(i)&""
end if
rsfile.open strSQL,conn,1,1
if not(rsfile.eof and rsfile.bof) then
do while not rsfile.eof
file1=server.mappath( rsfile("fileurl_path")&rsfile("fileurl_name") )
set tfo=Server.CreateObject("Scripting.FileSystemObject")
if tfo.FileExists(file1) = True Then '判斷文件是否存在
set nf=tfo.GetFile(file1)
nf.delete
ErrCodes = ErrCodes & "<li> "&rsfile("fileurl_path")&rsfile("fileurl_name")&" 文件刪除成功!</li><br>"
else
ErrCodes = ErrCodes & "<li> "&rsfile("fileurl_path")&rsfile("fileurl_name")&" 文件已丟失!</li><br>"
end if
Set tfo = nothing
rsfile.movenext
loop
end if
rsfile.close
set rsfile=nothing
if IsSqlDataBase = 2 then
conn.execute"delete from filetest where ID ="&viewArray(i)&""
else
conn.execute"delete from [filetest] where ID ="&viewArray(i)&""
end if
Next
ErrCodes = ErrCodes & "<li> 所選文件儲存數據已全部清理!</li><br>"
call connclose()
response.write ("<script>opener.location.reload();</script>")
Call ShowAdminSuccessMsg(ErrCodes &"<li>所選操作已經執行成功!</li><br>","javascript:window.close()")
end if%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -