<SCRIPT language=javascript src="pict/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("pict/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()">
js+FSO遍历文件夹下文件并显示
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@