📄 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")
strSQL ="select fileurl_name,fileurl_path from [filetest] where ID ="&viewArray(i)&""
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
conn.execute"delete from [filetest] where ID ="&viewArray(i)&""
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 + -