//读文件
function readFile(filename){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile(filename,1);
var s = "";
var arr = new Array();
var i=0;
while (!f.AtEndOfStream) {
//s += f.ReadLine()+"\n";
arr[i]= f.ReadLine();
alert(arr[i]);
i++;
}
f.Close();
return s;
}
//写文件
function writeFile(filename){
var fso, f, s ;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile(filename,8,true);
f.WriteLine("姓名:");
f.WriteLine(document.getElementById(‘name‘).value);
f.Close();
}
————————————————
版权声明:本文为CSDN博主「Jun保屋」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_35060159/article/details/111978049