<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function searchFiles(a_path)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder(a_path);
var fc = new Enumerator(f.files);
var fk = new Enumerator(f.SubFolders);
var s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "<br/>";
}
for (; !fk.atEnd(); fk.moveNext())
{
s += fk.item();
s += "<br/>";
}
textarea.innerHTML = s
if (f.SubFolders.Count> 0 )//&& "bool"
{
for (; !fk.atEnd(); fk.moveNext())
{
searchFiles(fk.item());
}
}
}
function searchtools1()
{
searchFiles(document.all.fixfolder.value);
}
</script>
</head>
<body bgcolor="#FFFFFF">
指定文件夹:<input type="text" name="fixfolder" value ="C:\Users\lenovo\Desktop\excel工具\cpa">
<input type="button" value ="搜索" onclick="searchtools1()">
<table >
<tr>
<td id = "textarea">
</td>
</tr>
</table>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function searchFiles(a_path)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder(a_path);
var fc = new Enumerator(f.files);
var fk = new Enumerator(f.SubFolders);
var s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "<br/>";
}
for (; !fk.atEnd(); fk.moveNext())
{
s += fk.item();
s += "<br/>";
}
textarea.innerHTML = s
if (f.SubFolders.Count> 0 )//&& "bool"
{
for (; !fk.atEnd(); fk.moveNext())
{
searchFiles(fk.item());
}
}
}
function searchtools1()
{
searchFiles(document.all.fixfolder.value);
}
</script>
</head>
<body bgcolor="#FFFFFF">
指定文件夹:<input type="text" name="fixfolder" value ="C:\Users\lenovo\Desktop\excel工具\cpa">
<input type="button" value ="搜索" onclick="searchtools1()">
<table >
<tr>
<td id = "textarea">
</td>
</tr>
</table>
</body>
</html>