matrix3_file_del.asp

来自「这是ASP的OA」· ASP 代码 · 共 38 行

ASP
38
字号
<!-- #include file="const.asp" -->
<%
'response.End()
call opendb()
checkadmin()
dim keyword,type1,page,px,sql,rs,id,filepath,bbsid,objFSO
filepath=""
bbsid=0
id=nrequest("id")
keyword=request.QueryString("keyword")
type1=request.QueryString("type")
page=request.QueryString("page")
px=request.QueryString("px")
sql="select * from m3_uploadfiles where FileID='"&id&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.eof then
	filepath=trim(rs("filepath"))
	bbsid=rs("bbsid")
	rs.delete
	rs.update
end if
rs.close
set rs=nothing
if filepath<>"" then
	set objFSO=Server.CreateObject("Scripting.FileSystemObject")
	if objFSO.FileExists(Server.MapPath(filepath)) then    
    	objFSO.DeleteFile(Server.MapPath(filepath))
	end if
	set objFSO=nothing
end if
if bbsid<>0 then
	sql="update m3_bbs set uploadfile='',filepath='' where id="&bbsid&""
	conn.execute(sql)
end if
call closedb()
response.Redirect("matrix3_uploadfiles.asp?keyword="&keyword&"&type="&type1&"&px="&px&"&page="&page&"")
%>

⌨️ 快捷键说明

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