[HTML]从网页运行客户端程序 [英] [HTML] Run a client program from a web page
本文介绍了[HTML]从网页运行客户端程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,首先要提前感谢您的帮助。
我想从网页上运行客户端程序。当我点击网站上的运行记事本按钮时,它会在我的电脑中启动notepad.exe。
我试过.hta,和它运行良好。但我必须将.hta保存到我的电脑上并运行它。我想做的就是直接点击我网站上的按钮运行notepad.exe。
请帮我这个。
Hi, first of all thank you in advance for any help.
I would like to run a client program from a web page. The scenario like when I click a "Run notepad" button on a web site, it will start notepad.exe in my computer.
I have tried .hta, and it can run well. But I have to save .hta to my computer and run it. All I want to do is just run notepad.exe directly by clicking a button on my website.
Please help me with this.
推荐答案
检查此链接。它已经提供了一个代码来从浏览器执行记事本,虽然你可能需要稍微调整一下
http://social.msdn.microsoft.com/Forums/en-US/3444c3c3-eef7-4f6b-b67c-086e34fc74be/how-to-execute-an-executable-file-ex-notepad-using-javascript-which -will-work-in-mozilla-firefox [ ^ ]
Check this link. It has given a code to execute notepad from browser though you may need to tweek it a bit
http://social.msdn.microsoft.com/Forums/en-US/3444c3c3-eef7-4f6b-b67c-086e34fc74be/how-to-execute-an-executable-file-ex-notepad-using-javascript-which-will-work-in-mozilla-firefox[^]
<html>
<head>
<script language="JavaScript" type="text/javascript">
MyObject = new ActiveXObject( "WScript.Shell" )
function RunNotePad()
{
MyObject.Run("notepad") ;
}
</script>
</head>
<body>
<h1>Run a Program</h1>
This script launch the file >> c:\windows\notepad.exe<p>
<button onclick="RunNotePad()">Run Windows NotePad</button>
</body>
</html>
引用:
同样如果你想运行另一个命令MyObject.Run(no tepad);只需使用您的运行命令(如CMD,Explorer等)更改记事本
这篇关于[HTML]从网页运行客户端程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文