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 />");


}

你可能感兴趣的:(读取文件)