方法1:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form class="form-horizontal">javascript
<script type="text/javascript">
function runExecutable()
{
var executableFullPath=document.getElementById("path").value;
try {
var shellActiveXObject = new ActiveXObject("WScript.Shell");
if ( !shellActiveXObject )
{
alert('Could not get reference to WScript.Shell');
return;
}
shellActiveXObject.Run(executableFullPath, 1, false);
shellActiveXObject = null;
}
catch (errorObject)
{
alert('Error:\n' + errorObject.message);
}
}
</script>
<td>
<input type="file" webkitdirectory id="path">
</td>
<input type="button" onclick="runExecutable()" value="打开应用程序">
</body>
</html>html
只能够用IE浏览器打开,而且须要在工具安全中设置可以使用ActiveXObject控件java
方法2:利用html、angularjs和Python,在Python文件中引用import os,调用其中os.startfile(路径)方法,就能够打开本地文件了angularjs
方法3.利用URL Protocol实现网页调用本地应用程序 (可ctrl+点击查看网上相关资料):web
我直接用的 <a href="打开的exe://cid:110&username:xxh"><input value="打开本地应用程序" onclick="document.getElementById('light2').style.display='none'" type="button"></a>shell
对应的程序可能连接不同,可参考http://blog.csdn.net/zssureqh/article/details/25828683这个网址。浏览器