如何运行本地 Windows 应用程序并将输出通过管道传输到浏览器
我有 Windows 应用程序(.EXE 文件是用 C 编写并使用 MS-Visual Studio 构建的),它将 ASCII 文本输出到标准输出。我希望增强 ASCII 文本以包含有限的 HTML 和一些链接。我想调用此应用程序(.EXE 文件)并获取该应用程序的输出并将其通过管道传输到浏览器中。这不是一次性的事情,每个新网页都将是本地应用程序的另一次运行!
下面的 HTML/java 脚本应用程序可以帮助我执行该应用程序,但输出已进入 DOS 框窗口,而不是通过管道传输到浏览器中。我想更新此 HTML 应用程序,以使浏览器能够捕获该文本(通过 HTML 增强)并在浏览器中显示它。
<body>
<script>
function go() {
w = new ActiveXObject("WScript.Shell");
w.run('C:/DL/Browser/mk_html.exe');
return true;
}
</script>
<form>
Run My Application (Window with explorer only)
<input type="button" value="Go"
onClick="return go()">
</FORM>
</body>
I have Windows Application (.EXE file is written in C and built with MS-Visual Studio), that outputs ASCII text to stdout. I’m looking to enhance the ASCII text to include limited HTML with a few links. I’d like to invoke this application (.EXE File) and take the output of that application and pipe it into a Browser. This is not a one time thing, each new web page would be another run of the Local Application!
The HTML/java-script application below has worked for me to execute the application, but the output has gone into a DOS Box windows and not to pipe it into the Browser. I’d like to update this HTML Application to enable the Browser to capture that text (that is enhanced with HTML) and display it with the browser.
<body>
<script>
function go() {
w = new ActiveXObject("WScript.Shell");
w.run('C:/DL/Browser/mk_html.exe');
return true;
}
</script>
<form>
Run My Application (Window with explorer only)
<input type="button" value="Go"
onClick="return go()">
</FORM>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,这有效。它现在就发生在离我 5 英尺远的另一个隔间里。
Yes, this works. It is happening 5 feet away from me right now in another cubicle.
这称为 CGI
This is called CGI
您已经使用 WScript 启动,它还可以读取 StdOut 。
Your already using WScript to launch, it can also read StdOut.
让 EXE 创建一个包含 HTML 的临时文件,然后告诉 Windows 在浏览器中打开该临时 HTML 文件会更容易。
It would be easier to have your EXE create a temp file containing the HTML, then just tell Windows to open the temp HTML file in the browser.