我知道
<a href = 'ymsgr:sendim?contactID'>Send me a message</a>
将推出雅虎通。
我可以创建这样的东西来启动 MSWord 或我自己的应用程序吗?
我知道
<a href = 'ymsgr:sendim?contactID'>Send me a message</a>
将推出雅虎通。
我可以创建这样的东西来启动 MSWord 或我自己的应用程序吗?
这是对您所描述内容的解释:https ://stackoverflow.com/a/16586294/4500419
在这里您可以找到 Microsoft Office 的 URI 规范: https ://msdn.microsoft.com/en-us/library/office/dn906146.aspx#sectionSection4
所以,像
ms-word:ofv|u|http://yoursite.com/document.docx
将在 MS Word 中以只读模式打开 document.docx。
这是有关如何在 Windows 中将您自己的应用程序注册到 URI 方案的文档: https ://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
这也可以通过简单地将 html 文件命名为 .hta 来工作,如果它用于本地项目则很好
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp" APPLICATIONNAME="Application Executer" BORDER="no" CAPTION="no" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" SCROLL="no" WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("c:/windows/system32/notepad.exe", 1, false); }
</script>
</head>
<body>
<input type="button" value="Run Notepad" onclick="RunFile();"/>
</body>
</html>