通过网站在客户端计算机上运行应用程序 [英] Run an application on client machine through website

查看:127
本文介绍了通过网站在客户端计算机上运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过单击网页上的按钮在clinet端运行应用程序使用c#代码后面的javascript或代码?

How to run an application on clinet side by clicking button on web page Using javascript or code behind c# code?

推荐答案

您必须注册自定义协议/客户端上的URL(请参阅 http://msdn.microsoft。 com / zh-CN / library / aa767914%28v = vs.85%29.aspx [ ^ ])。

然后你添加一些链接,比如< a href =bernie:// someArgument>点击这里打开我的应用< / a>在页面中。

当用户单击该链接时,Windows会查看注册表如何处理该链接。在您的情况下,它将使用链接中给出的参数启动本地安装的应用程序。

我不知道细节,但这是要走的路。
You have to register a custom protocol/URL on the client first (see e.g. http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx[^]).
Then you add some link like <a href="bernie://someArgument">click here to open my app</a> in the page.
When the user clicks that link, Windows looks into the registry how to handle that link. In your case, it would start a locally installed application with the parameters given in the link.
I do not know the details, but that's the way to go.


以前的VBScript,启用客户端应用程序的JavaScript方法被禁止安全原因。


自定义协议处理程序可以是Bernhard Hiller建议的一种方法。它仍然可能是安全漏洞,因为它是全局的,不能局限于单个Web应用程序。

您可以使用Silverlight(http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx [ ^ ]并且可能Java FX和Flex也可以创建小程序,完全信任并且能够启动本地应用程序。



但是所有方法都需要客户端操作,可能是具有提升权限的安装。
The former VBScript, JavaScript methods that enabled one to start client side applications are banned for security reasons.

Custom protocol handler can be one approach as Bernhard Hiller suggested. Still it can be a security leak, since it is global and can not be restricted to a single web application.
You can use Silverlight (http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx[^]) and probably Java FX and Flex also to create "applets", with full trust, and capable of starting local application.

But all approaches need client action, probably an installation with elevated rights.


这篇关于通过网站在客户端计算机上运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆