wsh - JavaScript 中的文件结尾

标签 wsh jscript windows-scripting

我想用 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/

相关文章:

php - WSO2 WSF PHP - WSClientProxy -> __调用没有返回大响应

c# - 从 C# .ashx 运行 cscript.exe 不执行 vbscript 文件中的代码

wsh - 在命令行上通过 cscript 将参数传递给 javascript

dynamics-crm-2011 - 在 Microsoft CRM 2011 中设置 HTML Web 资源的 URL

python - 为什么我的 JSON 脚本没有从 FLASK 获取 JSONIFY 返回?

c# - 使用 Windows 脚本宿主

javascript - 在 HTA 文件中使用 Javascript 从 Windows 注册表读取/写入

c# - 如何更新 ClearScript 中的字典条目?

powershell - 如何在Powershell中输出粗体文本?

windows - 分配 Windows 登录脚本