国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 服務(wù)器 > Web服務(wù)器 > 正文

使用FSO按文件大小瀏覽文件目錄并進(jìn)行刪除操作

2024-09-01 13:42:32
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

<%@ 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 "輸入錯(cuò)誤!"  
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>輸入錯(cuò)誤!</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  
Response.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlf 
Response.Write "<TR>" & vbcrlf 
Response.Write "<TD>文件名及路徑</TD>" & vbcrlf 
Response.Write "<TD align=center>大小</TD>" & vbcrlf 
Response.Write "<TD align=center>類別</TD>" & vbcrlf 
Response.Write "<TD align=center>修改時(shí)間</TD>" & vbcrlf 
Response.Write "<TD align=center>刪除</TD>" & vbcrlf 
Response.Write "</TR>" & vbcrlf 
intFlag=ListFolderFiles(strPath,CDbl(intFileSize),0) 
Response.Write "<tr><td align=right>總計(jì):</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlf 
Response.Write "</TABLE>" & vbcrlf 
%> 
</BODY> 

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 搜索| 左云县| 大宁县| 涟源市| 莱芜市| 嘉峪关市| 濮阳县| 霍林郭勒市| 洛浦县| 泾川县| 德昌县| 衡阳市| 得荣县| 宣威市| 博湖县| 蕉岭县| 莒南县| 西宁市| 南宫市| 麻栗坡县| 新邵县| 佛冈县| 理塘县| 桂阳县| 阿图什市| 天津市| 铁岭市| 上犹县| 文登市| 康平县| 宁安市| 松江区| 大姚县| 通州区| 仙游县| 六盘水市| 资中县| 马山县| 石棉县| 五华县| 凤阳县|