如何在javascript写本地文件

 1<html>
 2<head>
 3</head>
 4<body>
 5<script language="Javascript"><!--   
 6var fso = new ActiveXObject("Scripting.FileSystemObject");   
 7var a = fso.CreateTextFile("c:\\\testfile.txt", true);   
 8a.WriteLine("This is a test.");   
 9a.Close();   
10alert("我已经在你的C盘根目录下生成了一个testfile.txt的文件!");   
11// --></script>
12</body>
13</html>
Published At
Categories with Web编程
comments powered by Disqus