js+FSO遍历文件夹下文件并显示
人气:0
<SCRIPT language=javascript src="picthttps://img.qb5200.com/download-x/datas.ini"></SCRIPT>
<script language=javascript>
var s="";
for(var i = 0; i < datas.length ; i++){
s+=datas[i]+"||||";
}
document.write(s);
</script>
<script language="javascript">
function init(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var folder = fso.GetFolder("pict");
var datas = fso.CreateTextFile("picthttps://img.qb5200.com/download-x/datas.ini",true);
datas.WriteLine("var datas = new Array();") ;
var fenum = new Enumerator(folder.Files);
for (var i = 0 ; !fenum.atEnd(); fenum.moveNext(),i++){
datas.WriteLine("datas["+ i +"] = \""+ fenum.item().Name +"\";") ;
}
datas.Close();
//var f1 = fso.GetFile("pict\\a.txt");
for(var file in folder.Files){
alert(file);
//alert("File last modified: " + file.DateLastModified);
}
}
</script>
<input type="button" value="初始化数据" onclick="init()">
<script language=javascript>
var s="";
for(var i = 0; i < datas.length ; i++){
s+=datas[i]+"||||";
}
document.write(s);
</script>
<script language="javascript">
function init(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var folder = fso.GetFolder("pict");
var datas = fso.CreateTextFile("picthttps://img.qb5200.com/download-x/datas.ini",true);
datas.WriteLine("var datas = new Array();") ;
var fenum = new Enumerator(folder.Files);
for (var i = 0 ; !fenum.atEnd(); fenum.moveNext(),i++){
datas.WriteLine("datas["+ i +"] = \""+ fenum.item().Name +"\";") ;
}
datas.Close();
//var f1 = fso.GetFile("pict\\a.txt");
for(var file in folder.Files){
alert(file);
//alert("File last modified: " + file.DateLastModified);
}
}
</script>
<input type="button" value="初始化数据" onclick="init()">
加载全部内容