使用FSO按文件大小浏览文件目录并进行删除操作
来源:互联网 发布:九阴捏脸数据女清纯 编辑:程序博客网 时间:2024/05/18 00:39
<%@ Language=VBScript %>
<%Server.ScriptTimeout=50000%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<BODY>
<%
function JudgeParaRegular(intID)
if intID<>"" and isnumeric(intID) then
JudgeParaRegular=intId
else
Response.Write "输入错误!"
Response.End
end if
end function
intFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))
strPath=Request.QueryString("strPath")
if instr(strPath,":")=0 then strPath=server.MapPath(strPath)
%>
<%
function deletefiles(path)
on error resume next
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(path) then
fs.DeleteFile path,True
response.write "成功删除"&path
else
response.write "文件不存在!"
end if
Set fs=nothing
if Err.number<>0 then Response.Write Err.number
end function
strFile=request("strFile")
if request("strFile")<>"" then
deletefiles strFile
end if
%>
<%
function ListFolderFiles(strPath,intFileSize,intFlag)
strOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")
if strPath<>"" then
if intFlag=0 then
intFlag=intFlag+1
end if
Set objFs=Server.CreateObject("Scripting.FileSystemObject")
Set objFdir=objFs.GetFolder(strPath)
strParentPath= objFs.GetParentFolderName(strPath)
for each strSubFiles in objFdir.files
if strSubFiles.size /(1024^2)>=intFileSize then
Response.Write "<TR>" & vbcrlf
Response.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlf
Response.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlf
Response.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlf
Response.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlf
Response.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlf
Response.Write "</TR>" & vbcrlf
intFlag=intFlag+strSubFiles.size
end if
next
for each strSubFolders in objFdir.SubFolders
if intFlag=0 then intFlag=1
ListFolderFiles strSubFolders,intFileSize,intFlag
next
else
Response.Write "<tr><td colspan=5>输入错误!</td></tr>"
end if
ListFolderFiles=intFlag
end function
function strNullTran(str)
if isnull(str) or str="" then
strNullTran=" "
else
strNullTran=str
end if
end function
- 使用FSO按文件大小浏览文件目录并进行删除操作
- 解压文件并进行删除等操作
- js 操作磁盘文件--使用fso
- 利用fso进行文件上传及删除(javascript版)
- FSO删除文件
- 将logcat写进SD卡(能追加)并按文件大小进行删除
- FSO文件操作类
- ASP FSO文件操作
- ASP FSO文件操作
- 使用“递归方法”对整个目录进行删除操作
- CaptainGan------ 使用“递归方法”对整个目录进行删除操作
- fso使用操作
- ASP FSO操作文件(复制文件、重命名文件、删除文件、替换字符串)
- ASP FSO操作文件(复制文件、重命名文件、删除文件、替换字符串)
- ASP FSO操作文件(复制文件、重命名文件、删除文件、替换字符
- 如何使用SWFTools 命令 将pdf文件转换为swf文件,并进行在线浏览该pdf文件
- Javascript操作文件(FSO)
- Javascript操作文件(FSO)
- 用ASP编程控制在IIS建立Web站点
- Linux下设置TOMCAT环境变量的三种方法
- 新西兰 working holiday visa
- 书画小说之古典艳情系列
- JavaScript 脚本文档之二(学习笔记)
- 使用FSO按文件大小浏览文件目录并进行删除操作
- 来篇文章:ASP。NET程序中动态修改web.config中的设置项目 (后台CS代码)
- 快速排序
- nyoj 740 “炫舞家“ST
- JAVA中extends 与implements区别
- 2014年面试官识人的五大额外小“潜规则”
- js金额格式化
- static函数与普通函数
- Xlib: connection to ":0.0" refused by server