var fso, f1, ts, s;
var ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile("c:\\testfile.txt", true);
// 写一行。
f1.WriteLine("Hello World");
f1.WriteBlankLines(1);
f1.Close();
// 读取文件的内容。 ts = fso.OpenTextFile("c:\\testfile.txt", ForReading);
s = ts.ReadLine();
ts.Close();
var ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile("c:\\testfile.txt", true);
// 写一行。
f1.WriteLine("Hello World");
f1.WriteBlankLines(1);
f1.Close();
// 读取文件的内容。 ts = fso.OpenTextFile("c:\\testfile.txt", ForReading);
s = ts.ReadLine();
ts.Close();
解决方案 »
- string类型的长度不是固定的,为何也算原始类型呢?确实存贮在“栈”中吗?
- 关于MouseOver实践
- js实现这样的效果
- 如何知道键盘按了F5刷新窗口
- localhost 和 ip地址访问页面的问题
- 求教在body中加onload方法的问题!!!!!
- ********************对象为空或者不是对象*********************
- 在若干个checkbox(同名)里,如何获取我点击的那个checkbox的下标。
- BUI框架使用的时候出现Uncaught TypeError: Cannot read property 'hasError' of null 问题
- 获取移动设备信息
- 给个验证URL和email的函数来看看,最好有正则表达验证的
- HTML table 转化成 Excel电子表格? 请高手帮忙 :(
var ForReading = 1, ForWriting = 2;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);
f.Write("Header");
f.Write("1234567890987654321");
f.Close();
f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
alert(f.ReadAll());
jscript
http://www.microsoft.com/downloads/release.asp?ReleaseID=33136