delfileforup.asp

来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 72 行

ASP
72
字号
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
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" -->
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<% 'on error resume next
dim p,id
id=request("id")
fid=request("fid")
p=request("fpath")
 Dim objFSO    '声明一个名称为 objFSO 的变量以存放对象实例
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath(p)) Then
objFSO.DeleteFile Server.MapPath(p),True
   Else%>
<%
if(request("fid") <> "") then Command1__varid = request("fid")
if(Session("userssdfgfhtrh") <> "") then Command1__varuser = Session("userssdfgfhtrh")
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "DELETE FROM fawenfiles  WHERE id=" + Replace(Command1__varid, "'", "''") + " and 上传人帐号='" + Replace(Command1__varuser, "'", "''") + "' "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%
   End If
  Set objFSO = Nothing      
%>
<%

if(request("fid") <> "") then Command2__varid = request("fid")

if(Session("userssdfgfhtrh") <> "") then Command2__u = Session("userssdfgfhtrh")

%>
<%
set Command2 = Server.CreateObject("ADODB.Command")
Command2.ActiveConnection = MM_oavbsconn_STRING
Command2.CommandText = "DELETE FROM fawenfiles  WHERE id=" + Replace(Command2__varid, "'", "''") + " and 上传人帐号='" + Replace(Command2__u, "'", "''") + "' "
Command2.CommandType = 1
Command2.CommandTimeout = 0
Command2.Prepared = true
Command2.Execute()
%>
<%response.redirect "updateshenpimyfdda.asp?id="&cint(id)%>

⌨️ 快捷键说明

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