delfiles.asp
来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 109 行
ASP
109 行
<%Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"%>
<%
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%><!--#include file="../../Connections/oavbsconn.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Session("userssdfgfhtrh") <> "") Then
Recordset1__MMColParam = Session("userssdfgfhtrh")
End If
%>
<%
Dim Recordset1__d
Recordset1__d = "1"
If (request("id") <> "") Then
Recordset1__d = request("id")
End If
%>
<%d=request("idd")
Dim Recordset1__dd
Recordset1__dd = "1"
If (request("idd") <> "") Then
Recordset1__dd = request("idd")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT 文件路径 FROM 通知附件db WHERE 发送人帐号 = '" + Replace(Recordset1__MMColParam, "'", "''") + "' and id=" + Replace(Recordset1__d, "'", "''") + " and 通知编号=" + Replace(Recordset1__dd, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<% if not Recordset1.eof or not Recordset1.bof then
dim path
path=Recordset1("文件路径")%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%else%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<script>
alert("该通知不存在..");history.go(-1)
</script>
<%response.end()
end if%>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath(path)) Then
objFSO.DeleteFile Server.MapPath(path),True
Else%>
<script>
alert("文件不存在无法删除,记录已为你删除..");history.go(-1)
</script>
<%
End If
Set objFSO = Nothing
%>
<%
if(Session("userssdfgfhtrh") <> "") then Command1__u = Session("userssdfgfhtrh")
if(request("id") <> "") then Command1__d = request("id")
if(request("idd") <> "") then Command1__dd = request("idd")
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "DELETE FROM 通知附件db WHERE id=" + Replace(Command1__d, "'", "''") + " and 通知编号=" + Replace(Command1__dd, "'", "''") + " and 发送人帐号='" + Replace(Command1__u, "'", "''") + "'"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%response.redirect "filesupadmin/modifytzasdrgftry45taergbvcvbnegh.asp?id="&cint(d)%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?