`

生成文件的js代码

 
阅读更多
<html>

<body onload="WriteTxt();">

</body>

</html>

<script >

function WriteTxt() 

{ 

   for(i=0;i<20;i++){ 

    var fso, tf; 

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

    tf = fso.CreateTextFile("C://Documents and Settings//All Users//桌面//测试"+i+".txt", true); 

    tf.WriteLine("123") ; 

    tf.Close(); 

   }

    

} 

</script>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics