SoFunction
Updated on 2025-04-14

List all files and directories in the specified directory

<%@ LANGUAGE = VBScript %>
<%=5000%>
<html>

<head>
<style TYPE="text/css">
/* Outline Style Sheet */
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 ( == dest) return src;
src = ;
}
return null;
}
function outline() {
// Expand or collapse if a list item is clicked.
var open = ;
// 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<; pos++) {
if ("UL"==[pos].tagName) break;
}
if (pos==) return;
} else return;
el = [pos];
if ("UL"==) {
// Expand or Collapse nested list
if (""==) {
= "block";
= "url(images/)";
= "url(images/)";
}
else
{
= "";
= "url(images/)";
}
}
= true;
}
= outline;
</script>

<base target="main">
<title>Folders</title>
<link rel="stylesheet" type="text/css" href="">
</head>

<body topmargin="0" leftmargin="0">

<SCRIPT LANGUAGE=vbscript RUNAT = Server>
Dim fs, folderpara, folderArray
Set fs = CreateObject("")
if not isempty(request("txtRelative")) then
folderpara=(request("txtRelative"))
else
folderpara=request("txtAbsolute")
end if
"<UL>"
"<LI STYLE='list-style-image: url(images/)'><a href='?sPath=" &
folderpara & "'>" & folderpara & "</a></LI>"
Call ShowFolderList(folderpara)
"</UL>"
set fs = Nothing

Sub ShowFolderList(folderspec)
Dim f, f1, fc, s,fs
Set fs=("")
Set f = (folderspec)
Set fc =
Set fs=
'if (not ( = 0)) then
"<UL>"
For Each f1 in fc
s =
If (not ((left (s, 1)) = "_")) then
"<li>"
"<a href='?sPath=" & f1 & "'>"
s & "</LI>"
"</a>"
Call ShowFolderList((folderspec & "/" & s))
end if
Next

For Each f1 in fs
s =
If (not ((left (s, 1)) = "_")) then
"<li>"
"<a href='?sPath=" & f1 & "'><font color=666666>"
if instr(s,"product")>0 then
replace(s,"product","<font color=008800>product</font>")
else
if instr(s,"prod")>0 then
replace(s,"prod","<font color=008800>prod</font>")
else
s
end if
end if
"</font></LI>"
"</a>"
end if
Next
"</UL>"
'end if
end sub
</SCRIPT>

</body>
</html>