针对有网友说看不见文章内容, 现提示如下: 点击每一个标题行任一地方都会展开和隐藏此文章内容(不要点击标题). 目前展开隐藏功能只支持IE浏览器,虽然可以改成支持FF浏览器,不过现在一直没时间去弄,等有时间再修改了。 |
blog名称:乱闪Blog 日志总数:267 评论数量:1618 留言数量:-26 访问次数:2673362 建立时间:2005年1月1日 |
|

| |
使用FSO按文件大小浏览文件目录并进行删除操作
|
<%@ 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) thenJudgeParaRegular=intIdelseResponse.Write "输入错误!" Response.End end ifend functionintFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))strPath=Request.QueryString("strPath")if instr(strPath,":")=0 then strPath=server.MapPath(strPath)%><%function deletefiles(path)on error resume nextSet fs=Server.CreateObject("Scripting.FileSystemObject")if fs.FileExists(path) thenfs.DeleteFile path,Trueresponse.write "成功删除"&pathelseresponse.write "文件不存在!"end ifSet fs=nothingif Err.number<>0 then Response.Write Err.number end functionstrFile=request("strFile")if request("strFile")<>"" thendeletefiles strFileend if
%>
<%function ListFolderFiles(strPath,intFileSize,intFlag)strOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")if strPath<>"" thenif intFlag=0 thenintFlag=intFlag+1end if Set objFs=Server.CreateObject("Scripting.FileSystemObject")Set objFdir=objFs.GetFolder(strPath)strParentPath= objFs.GetParentFolderName(strPath)for each strSubFiles in objFdir.filesif strSubFiles.size /(1024^2)>=intFileSize thenResponse.Write "<TR>" & vbcrlfResponse.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlfResponse.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlfResponse.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlfResponse.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlfResponse.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlfResponse.Write "</TR>" & vbcrlfintFlag=intFlag+strSubFiles.sizeend ifnextfor each strSubFolders in objFdir.SubFoldersif intFlag=0 then intFlag=1ListFolderFiles strSubFolders,intFileSize,intFlagnextelseResponse.Write "<tr><td colspan=5>输入错误!</td></tr>"end ifListFolderFiles=intFlagend functionfunction strNullTran(str)if isnull(str) or str="" thenstrNullTran=" "elsestrNullTran=strend ifend function Response.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlfResponse.Write "<TR>" & vbcrlfResponse.Write "<TD>文件名及路径</TD>" & vbcrlfResponse.Write "<TD align=center>大小</TD>" & vbcrlfResponse.Write "<TD align=center>类别</TD>" & vbcrlfResponse.Write "<TD align=center>修改时间</TD>" & vbcrlfResponse.Write "<TD align=center>删除</TD>" & vbcrlfResponse.Write "</TR>" & vbcrlfintFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)Response.Write "<tr><td align=right>总计:</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlfResponse.Write "</TABLE>" & vbcrlf%></BODY></HTML> |
|
|