📄 down_del.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Option Explicit%>
<!--#include file="../../Conn.asp"-->
<!--#include file="../../SysCls/KS_CommonCls.asp"-->
<!--#include file="../Inc/Session.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2006-2008 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New Down_Del
KSCls.Execute()
Set KSCls = Nothing
Class Down_Del
Private KSCMS
Private Sub Class_Initialize()
Set KSCMS=New CommonCls
End Sub
Private Sub Class_Terminate()
Call KSCMS.CloseConn()
Set KSCMS=Nothing
End Sub
'主体部分
Public Sub Execute()
Dim K, DownID, CurrPath, DownDir, FolderID, Page, DisplayMode
Dim DownContentArr, TotalPage, I, CurrPathAndName, FExt, Fname
Dim KeyWord, SearchType, StartDate, EndDate
'收集搜索参数
KeyWord = KSCMS.G("KeyWord")
SearchType = KSCMS.G("SearchType")
StartDate = KSCMS.G("StartDate")
EndDate = KSCMS.G("EndDate")
Page = Request("Page")
DisplayMode = KSCMS.G("DisplayMode")
DownID = KSCMS.G("DownID")
DownID = Split(DownID, ",")
Dim RS
Set RS=Server.CreateObject("ADODB.Recordset")
For K = LBound(DownID) To UBound(DownID)
'删除评论
conn.Execute ("Delete From KS_Comment Where ChannelID=3 and InfoID='" & DownID(K) & "'")
RS.Open "Select * FROM [KS_DownLoad] Where DownID='" & DownID(K) & "'", conn, 1, 3
If RS.EOF And RS.BOF Then
Call KSCMS.AlertHistory("参数传递出错!", -1)
Set KSCMS = Nothing
Exit Sub
Else
FolderID = Trim(RS("Tid"))
If Not KSCMS.ReturnPowerResult(3, "KMD10014") Then '检查是否有删除下载的权限
Call KSCMS.ReturnErr(2, "Down_Main.asp?DisplayMode=" & DisplayMode & "&Page=" & DisplayMode & "&ID=" & FolderID)
Exit Sub
End If
FExt = Mid(Trim(RS("Fname")), InStrRev(Trim(RS("Fname")), ".")) '分离出扩展名
Fname = Replace(Trim(RS("Fname")), FExt, "") '分离出文件名 如 2005/9-10/1254ddd
'删除物理文件
Dim FolderRS
Set FolderRS=Server.CreateObject("ADODB.Recordset")
FolderRS.Open "Select Folder From [KS_Class] WHERE ID='" & FolderID & "'", conn, 1, 1
DownDir = KSCMS.GetConfig("DownDir")
If Left(DownDir, 1) = "/" Or Left(DownDir, 1) = "\" Then DownDir = Right(DownDir, Len(DownDir) - 1)
CurrPath = KSCMS.GetConfig("InstallDir") & DownDir & FolderRS("Folder")
' DownContentArr = Split(RS("DownContent"), "[NextPage]")
' TotalPage = UBound(DownContentArr) + 1
' If TotalPage > 1 Then
' For I = LBound(DownContentArr) To UBound(DownContentArr)
' If I = 0 Then
' CurrPathAndName = CurrPath & RS("Fname")
' Else
' CurrPathAndName = CurrPath & Fname & "_" & (I + 1) & FExt
' End If
' Call KSCMS.DeleteFile(CurrPathAndName)
' Next
' Else
CurrPathAndName = CurrPath & RS("Fname")
Call KSCMS.DeleteFile(CurrPathAndName)
' End If
FolderRS.Close
End If
RS.Delete
RS.Close
Next
Set RS = Nothing
If KeyWord = "" Then
If KSCMS.GetConfig("ShowDetail") = 1 Then '判断是否左栏显示详细信息
Response.Write ("<script>location.href='Down_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';parent.frames['LeftFrame'].LeftInfoFrame.location.href='Down_Left.asp?Type=0&ID=" & FolderID & "';</script>")
Else
Response.Write ("<script>location.href='Down_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';</script>")
End If
Else
Response.Write ("<script>location.href='Down_Main.asp?KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate & "&ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';</script>")
End If
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -