How can I launch a windows application from a webpage?

风流意气都作罢 提交于 2019-12-07 05:27:32

问题


We have a company intranet and the powers that be think it would be nice to have a collection of icons/links representing the applications that most reps use (Outlook, Excel, few other apps).

The idea would be that if the application is installed, clicking the link/icon would launch the application on the client machine.

Anyone ever had a requirement like that and been successful implementing it?

Wanted to reach out to everyone before I go back and say no. Thanks in advance for any replies.


回答1:


Make each button be a link to download a company template file for the given application. For example, the "Excel" button would download and the user should be prompted to open it with Excel.

For instance, try clicking one of the links here:

http://www.google.com/#sclient=psy&hl=en&q=template+filetype:xls

Linking to static files on the web server should be sufficient, so long as your server sends the correct MIME-Type or Content-Type.




回答2:


You will probably have to adjust browsers' security settings to allow them to follow the links, but you should be able to use URLs of the form file:///C:\\Program Files\\Notepad.exe (You might prefer to use normal slashes / instead, as you don't have to watch out for how many copies of \ are needed to get past quoted string interpretation in whatever you're using to design the web page(s).




回答3:


Using IE on a local intranet we have implemented this in an ActiveX control. Josh Pearce's solution works for those types of apps with MIME types, but not all apps you may wish to open would work this way.



来源:https://stackoverflow.com/questions/5237888/how-can-i-launch-a-windows-application-from-a-webpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!