📄 functions.asp
字号:
<%
'*******************************************
'过程作用:删除选定的文件或文件夹
'*******************************************
Sub Del_Dir_Files(Des, sType)
Dim FolderId,FileId,FileNum,FolderNum,FilePath,FolderPath,Fso
FileNum=0
FolderNum=0
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
Select Case sType
Case "Folder"
FolderId = Split(Des,",")
For i = 0 to Ubound(FolderId)
FolderPath = trim(FolderId(i))
If Fso.FolderExists(FolderPath) then
Fso.DeleteFolder FolderPath,true
FolderNum = FolderNum + 1
End If
Next
Case "File"
FileId = Split(Des,",")
For j = 0 to Ubound(FileId)
FilePath = trim(FileId(j))
If Fso.FileExists(FilePath) then
Fso.DeleteFile FilePath,true
FileNum = FileNum + 1
End If
Next
end select
Response.write "<script>alert('\n恭喜,删除成功\n\n"& FolderNum &" 个文件夹被删除\n"& FileNum &" 个文件被删除');window.location.href=('"& Replace(Request.ServerVariables("HTTP_REFERER"),"\","\\") &"')</script>"
response.end
End Sub
Function Replace_Html(str)
Dim TmpStr
str = Replace(str, "'", "")
str = Replace(str, ";", "")
str = Replace(str, "&", "")
Do While InStr(str, "<") > 0
TmpStr = Mid(str, InStr(str, ">") + 1)
str = Left(str, InStr(str, "<") - 1) & TmpStr
Loop
Do While InStr(str, Chr(10) & Chr(10)) > 0
str = Replace(str, Chr(10) & Chr(10), Chr(10))
Loop
Do While InStr(str, Chr(10)) = 1
str = Mid(str, 2)
Loop
Replace_Html = str
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -