📄 user_softdel.asp
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/config.asp"-->
<%
if CheckUserLogined()=False then
response.Redirect "User_Login.asp"
end if
dim SoftID,Action,sqlDel,rsDel,FoundErr,ErrMsg,PurviewChecked,ObjInstalled
SoftID=trim(request("SoftID"))
Action=Trim(Request("Action"))
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
FoundErr=False
if Action="" or Action<>"Del" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
end if
if FoundErr=False then
if instr(SoftID,",")>0 then
dim idarr,i
idArr=split(SoftID)
for i = 0 to ubound(idArr)
call DelSoft(clng(idarr(i)))
next
else
call DelSoft(clng(SoftID))
end if
end if
call CloseConn()
if FoundErr=False then
response.Redirect "User_SoftManage.asp"
else
call WriteErrMsg()
end if
sub DelSoft(ID)
PurviewChecked=False
sqlDel="select * from Soft where SoftID=" & CLng(ID)
Set rsDel= Server.CreateObject("ADODB.Recordset")
rsDel.open sqlDel,conn,1,3
if rsDel.bof and rsDel.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到要删除的软件!</li>"
else
if rsDel("Editor")=Trim(Request.Cookies("luyeweb")("UserName")) then
if rsDel("Passed")=True then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>删除软件“" & rsDel("SoftName") & "”失败。原因:此软件已经被审核通过,你不能再删除!</li>"
end if
else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>删除软件“" & rsDel("SoftName") & "”失败。原因:此软件是其他网友添加的,你不能删除其他人添加的软件!</li>"
end if
end if
if FoundErr=False then
rsDel("Deleted")=True
rsDel.update
end if
rsDel.close
set rsDel=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -