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

📄 admin_articledel.asp

📁 大榕树网络文章管理系统
💻 ASP
字号:
<%
Option Explicit
Response.buffer=true
const purviewlevel=3
%>
<!--#include file="admin_PurviewChe.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="../inc/webconfig.asp" -->
<!--#include file="admin_function.asp" -->
<%
dim ArticleID,Action,sqlDel,rsDel,FoundErr,ErrMsg
ArticleID=trim(request("ArticleID"))
Action=Trim(Request("Action"))
FoundErr=False


if ArticleId="" or Action<>"Del" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
end if
if FoundErr=False then
	if instr(ArticleID,",")>0 then
		dim idarr,i
		idArr=split(ArticleID)
		for i = 0 to ubound(idArr)
			call DelArticle(clng(idarr(i)))
		next
	else
		call DelArticle(clng(ArticleID))
	end if
end if
if FoundErr=False then
	call CloseConn()
	response.Redirect "admin_ArticleMan.asp"
else
	call CloseConn()
	call ShowErrMsg()
end if

sub DelArticle(ID)
	Set rsDel= Server.CreateObject("ADODB.Recordset")
	sqlDel="select * from article where ArticleID=" & CLng(ID)
	rsDel.open sqlDel,conn,1,3
	if rsDel.bof and rsDel.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>?????:" & rsDel("ArticleID") & " </li>"
	else
	if FoundErr=False then
	dim ObjInstalled
	ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
		if DelUpFiles="yes" and ObjInstalled=True then
			dim fso,strUploadFiles,arrUploadFiles
			strUploadFiles=rsDel("uploadfiles") & ""
			if strUploadFiles<>"" then
				Set fso = CreateObject("Scripting.FileSystemObject")
				if instr(strUploadFiles,"|")>1 then
					arrUploadFiles=split(strUploadFiles,"|")
					for i=0 to ubound(arrUploadFiles)
						if fso.FileExists(server.MapPath("../" & arrUploadfiles(i))) then
							fso.DeleteFile(server.MapPath("../" & arrUploadfiles(i)))
						end if
					next
				else
					if fso.FileExists(server.MapPath("../" & strUploadfiles)) then
						fso.DeleteFile(server.MapPath("../" & strUploadfiles))
					end if
				end if
				Set fso=nothing
			end if
		end if
		rsDel.delete
		rsDel.update
		set rsDel=nothing
		conn.execute "delete from Comment where ArticleID=" & CLng(ID)
	end if
	end if
end sub
%>

⌨️ 快捷键说明

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