📄 superdelfenlei.asp
字号:
<!-- #include file=makehtmfile.asp -->
<html>
<head>
<title><%=titlename%></title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="../html/style.css">
</head>
<body bgcolor=ccbbaa>
<%
function deletefloders(path)
'on error resume next
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FolderExists(path) then
fs.DeleteFolder path,True
response.write "<br>成功删除目录"&path
else
response.write "<br>目录不存在!"
end if
Set fs=nothing
end function
Set rs = Server.CreateObject("ADODB.Recordset")
%>
<!-- #include file=../database.asp -->
<%
sql="select * from ourusers where Ltrim(Rtrim(username))='supervisor'"
rs.open sql,conn,1,1
if not rs.eof then
if trim(rs("pass"))<>session("pass") then
response.write "<br>错误的密码!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
else
rs.close
end if
else
response.write "错误:用户不存在!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
fid=request("fid")
if isNumeric(fid)=0 or fid="" then
response.write "操作失败!!"
conn.close
set conn=nothing
response.end
end if
if fid<0 then
response.write "操作失败!!"
conn.close
set conn=nothing
response.end
end if
sql="select * from fenlei where id="&fid
rs.open sql,conn,1,1
if rs.eof then
response.write "没有找到这个分类!!删除失败."
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
else
response.write "删除将删除这个分类下的所有网站!!<br>现在正在检查这个分类下是否有子分类..."
fenleifather=rs("father")
rs.close
sql="select * from fenlei where father="&fid
rs.open sql,conn,1,1
if not rs.eof then
response.write "<br><br>不能删除,因为这个分类下<font color=ff0000>有子分类</font>,先进入这个分类再选择相应的子分类进行删除"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
else
response.write "<br>没有子分类,现在开始删除分类表中相关的...."
rs.close
end if
response.write "<br>现在开始处理网站表!"
sql="select count(*) from linking where fenleiid="&fid
set nm=conn.execute(sql)
num=nm(0)
nm.close
set nm=nothing
sql="delete from linking where fenleiid="&fid
conn.execute(sql)
response.write "<br>共有"&num&"个网站被删除!"
conn.execute "DELETE FROM " _
& "fenlei WHERE id = "&fid
response.write "<br>开始删除硬盘上的HTML文件和对应的分类目录....."
response.write "<br>最终处理分类表成功,此分类被成功删除!!"
deletefloders(getfenleidirecttrue(fid))
response.write "<br>成功删除硬盘上的分类文件及目录!!"
response.write "<br>现在开始更新他的上一级分类的html文件....."
if int(fenleifather)=0 then
response.write "<br>正在更新总分类......<br>"
strFenleiDirect=server.mapPath(dirstring&"navigate/")
response.write strFenleiDirect
if writeFenleiFiles(strFenleiDirect,0)=0 then
response.write "<br>建立分类HTM文件失败!"
else
response.write "<br>建立分类HTM文件成功!"
end if
else
response.write "<br>正在更新上一级分类......<br>"
if writeFenleiFiles(getfenleidirecttrue(fenleifather),fenleifather)=0 then
response.write "<br>建立分类HTM文件失败!"
else
response.write "<br>建立分类HTM文件成功!"
end if
end if
end if
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -