日期:2014-05-18 浏览次数:20990 次
var fso = new ActiveXObject("Scripting.FileSystemObject"); var a = fso.CreateTextFile("c:\\testfile.txt", true); a.WriteLine("This is a test."); a.Close();
------解决方案--------------------
<html> <head> </head> <body> <script language="Javascript"><!-- var fso = new ActiveXObject("Scripting.FileSystemObject"); var a = fso.CreateTextFile("c://yourfile.txt", true); a.WriteLine("This is a test."); a.Close(); alert("我已经在你的C盘根目录下生成了一个testfile.txt的文件!"); // --></script> </body> </html>