我知道这已经在另一个问题中得到了回答,但我根本不明白它是如何完成的。
我正在尝试将命令行程序(Aria2 下载器)的输出转换为 HTA 脚本,以便对其进行解析,并且可以获取下载百分比、文件大小等并将其动态更新为 DIV。
这是我已经调整并一直在尝试使用的代码,但它只是锁定界面,直到命令行完成,然后显示所有输出,而不是在它通过时显示它。
Const WshRunning = 0
Const WshFinished = 1
Const WshFailed = 2
strCommand = "ping.exe 127.0.0.1"
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand)
Do While WshShellExec.Status = WshRunning
window.setTimeOut "", 100
Loop
Select Case WshShellExec.Status
Case WshFinished
strOutput = WshShellExec.StdOut.ReadAll()
Case WshFailed
strOutput = WshShellExec.StdErr.ReadAll()
End Select
Set objItem = Document.GetElementByID("status")
objItem.InnerHTML = "" & strOutput & ""
如何修改它,使其不会锁定我的用户界面并抓取输出并将其显示在“状态”div中?