我想用 JavaScript 逐行读取本地文件。但我可以检查它是否到达该文件的末尾。例如:
file = new ActiveXObject("Scripting.FileSystemObject");
// Sets the variable "f" to equal the new open file contents
f = file.OpenTextFile("c:\\wantlist.txt", 1);
s = f.ReadLine()
While(s != EOF)
{
//. Do some thing
s = f.ReadLine()
}
JavaScript 中的 EOF 应该是什么?或者你有其他方法来处理这个问题吗?非常感谢!
最佳答案
关于wsh - JavaScript 中的文件结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12680293/