⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p_clear.asp

📁 这是一个ASP+VBScript+Access开发的网上家园源程序
💻 ASP
字号:
<!--#include file="connect.asp" -->
<%
if request.Cookies("admin") = "" then
user = request.form("username")
'password = md5(request.form("pass"))
password = request.form("pass")
'response.write user &"/"&password
'response.end
strSQL = "select * from information where user = '"&user&"' and password = '"&password&"'"
'response.write "strSQL:"&strSQL

set rs = objCnn.Execute(strSQL)
'response.end

if rs.eof then
	msg = "用户名或密码错误!"
%>
<Script language=VBScript>
msgbox "<%=msg%>"
window.close
</Script>
<%
response.end
else
	response.Cookies("admin") = rs("admin")
	response.Cookies("user") = user
	response.Cookies("password") = password
	
end if
rs.close
set rs=nothing
end if


strSQL = "select * from information"
set rs1 = objCnn.Execute(strSQL)

folderspec=server.mappath("..") &"\uppic\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files

i=0
For Each f1 in fc
	flage=True
	rs1.movefirst
	do while not rs1.eof
	if f1.name=rs1("pic") then
	flage = False
	exit do
	end if
	rs1.movenext
	loop
	if flage then
		i=i+1
		%>
<Script language=VBScript>
msg=msg & "删除: "&"<%=f1.name%>" & vbCrlf
</Script>
<%
		fso.deletefile(folderspec&f1.name)
	end if
Next

Set fso=nothing
Set f=nothing
Set fc=nothing
%>
<Script language=VBScript>
msg = msg& vbCrlf & vbCrlf & "清理完成" & vbCrlf & "共清理删除图片文件 <%=i%> 个!"
msgbox msg,,"图片清理"
window.close
</Script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -