时间:2021-05-25
<%@ LANGUAGE = VBScript %>
<%Server.ScriptTimeout=5000%>
<html>
<head>
<style TYPE="text/css">
UL UL {display: none;
margin-left: 20pt}
</style>
<script LANGUAGE="JavaScript">
function checkParent(src, dest) {
// Search for a specific parent of the current element
while (src!=null) {
if (src.tagName == dest) return src;
src = src.parentElement;
}
return null;
}
function outline() {
// Expand or collapse if a list item is clicked.
var open = event.srcElement;
// Make sure clicked inside an LI. This test allows rich HTML inside lists.
var el = checkParent(open, "LI");
if (null!=el) {
var pos = 0;
// Search for a nested list
for (var pos=0; pos<el.children.length; pos++) {
if ("UL"==el.children[pos].tagName) break;
}
if (pos==el.children.length) return;
} else return;
el = el.children[pos];
if ("UL"==el.tagName) {
// Expand or Collapse nested list
if (""==el.style.display) {
el.style.display = "block";
el.style.listStyleImage = "url(images/folder.gif)";
el.parentElement.style.listStyleImage = "url(images/ofolder.gif)";
}
else
{
el.style.display = "";
el.parentElement.style.listStyleImage = "url(images/folder.gif)";
}
}
event.cancelBubble = true;
}
document.onclick = outline;
</script>
<base target="main">
<title>Folders</title>
<link rel="stylesheet" type="text/css" href="ase.css">
</head>
<body topmargin="0" leftmargin="0">
<SCRIPT LANGUAGE=vbscript RUNAT = Server>
Dim fs, folderpara, folderArray
Set fs = CreateObject("Scripting.FileSystemObject")
if not isempty(request("txtRelative")) then
folderpara=server.mappath(request("txtRelative"))
else
folderpara=request("txtAbsolute")
end if
Response.write "<UL>"
Response.write "<LI STYLE='list-style-image: url(images/folder.gif)'><a href='files.asp?sPath=" &
folderpara & "'>" & folderpara & "</a></LI>"
Call ShowFolderList(folderpara)
Response.write "</UL>"
set fs = Nothing
Sub ShowFolderList(folderspec)
Dim f, f1, fc, s,fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
Set fs=f.Files
'if (not (fc.count = 0)) then
Response.write "<UL>"
For Each f1 in fc
s = f1.name
If (not ((left (s, 1)) = "_")) then
Response.write "<li>"
Response.write "<a href='files.asp?sPath=" & f1 & "'>"
Response.write s & "</LI>"
Response.write "</a>"
Call ShowFolderList((folderspec & "/" & s))
end if
Next
For Each f1 in fs
s = f1.name
If (not ((left (s, 1)) = "_")) then
Response.write "<li>"
Response.write "<a href='files.asp?sPath=" & f1 & "'><font color=666666>"
if instr(s,"product")>0 then
Response.write replace(s,"product","<font color=008800>product</font>")
else
if instr(s,"prod")>0 then
Response.write replace(s,"prod","<font color=008800>prod</font>")
else
Response.write s
end if
end if
Response.write "</font></LI>"
Response.write "</a>"
end if
Next
Response.write "</UL>"
'end if
end sub
</SCRIPT>
</body>
</html>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
Java递归列出目录下全部文件/***列出指定目录的全部内容**/importjava.io.*;classRecursion{publicstaticvoid
1、删除目录及目录下所有的文件2、删除目录下的所有文件但目录结构保留3、删除指定文件代码如下/**+------------------------------
复制代码代码如下:///删除文件和目录publicclassCleaner
{
//////删除指定目录以及该目录下所有文件//////
GetOwner.VBS用法,在命令行下:GetOwner.vbs目录名会在相应目录下生成一个TXT.TXT文件,内里列出该目录下所有文件和文件夹的类型,大小,
java递归读取目录下的所有文件(包含子目录下的所有文件)大概思路如下:通过file.listFiles()方法获取目录下的所有文件(包含子目录下的所有文件),