js 读取文件夹

<script language="Javascript"type="text/javascript">


var fso=new ActiveXObject("Scripting.FileSystemObject");


var folder=fso.GetFolder("H:\Music");


alert("文件数:"+folder.Files.Count);


var filesEnum=new Enumerator(folder.Files);


for(;!filesEnum.atEnd();filesEnum.moveNext())


{


document.write(filesEnum.item().Name+"<br />");


}
posted @ 2011-06-01 15:19  俗雅冰山  阅读(374)  评论(0编辑  收藏  举报