javascript 获取指定目录下的所有文件
function ShowFolderFileList(folderspec) {
var fso, f, f1, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.files);
s = ""; //文件名列表
var i = 0; //文件总数量
for ( ; !fc.atEnd(); fc.moveNext()) {
s += fc.item() + "
";
i++;
}
alert(i);
document.write(s);
}
阅读(940) | 评论(0) | 转发(0) |