如何使WebKit的或IE浏览器调用从浏览器中打开HTML网页应用程序(.NET)?

问题描述:

我在Windows上运行.NET应用程序。我想点击某些页面元素(按钮链接Flash应用程序等),以推出一些特殊的参数,我的应用程序。 (它应该运行不只是在IE浏览器,但是,基于WebKit的浏览器窗口太)在应用程序安装,我们假设用户是管理员,并在运行Vista或Windows 7或更高版本。

I have a .NET application running on windows. I want clicking on some page element (button link flash app etc) to launch my app with some special parameters. (It should run not just in IE but on WebKit based windows browsers too) During App install we suppose that user is Admin and is running Vista or Windows 7 or Later.

所以我的问题是 - 哪里可以得到这种互动的例子(当然,源)?

So my question is - Where to get examples of such interaction (WITH source of course)?

那么如何让基于WebKit的浏览器或IE浏览器调用.NET应用程序?

So how to make WebKit based Browser or IE call your .Net application?

Register自定义URL协议处理器。然后,你可以使用链接指定的URL,等:

Register a custom URL Protocol Handler. Then you can specify the url using links, etc:

<a href="myapp://doSomething/>Click to run my app!</a>


我可以证实,这适用于所有版本的Internet Explorer。我也在Firefox(3.6)和Chrome(其版本逃脱我)的最新版本进行了测试。 Chrome浏览器不会允许你输入一个自定义的协议到地址栏,但它会从链接使用自定义协议启动应用程序。


I can confirm that this works in all versions of Internet Explorer. I've also tested it in the latest versions of Firefox (3.6) and Chrome (whose version escapes me). Chrome will not allow you to enter a custom protocol into the address bar, but it will launch applications from links using custom protocols.

如果您已经安装Adobe Reader,该杂技演员:// 协议注册。遗憾的是,不使用自定义的协议允许的联系,所以我不能添加的例子在这里,我很害怕。

If you have Adobe Reader installed, the acrobat:// protocol is registered. Unfortunately, SO doesn't allow links using custom protocols, so I can't add an example here I'm afraid.