从电子邮件超链接打开应用程序,并通过论证 [英] Open application and pass arguments from hyper-link in email

查看:715
本文介绍了从电子邮件超链接打开应用程序,并通过论证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是所有国内与可信赖/完全访问权限进行。

This is all done internally with trusted/full access.

我怎么能打开我的应用程序,从电子邮件中的超链接,传递参数?

How can I open my application from a hyper-link in an email and pass arguments?

我明白我可以建立一个文件/链接类型关联(虽然我不知道该如何编程或安装过程中做到这一点)。这是最好的方法和/或我将如何设置呢?

I understand I can set up a file/link type association (although I'm unsure how to do this programmatically or during installation). Is this the best approach and/or how would I set this up?

我可以传递参数时,打开应用程序(似乎有点哈克的方式做到这虽然),但这不会工作,当应用程序已经打开(仅适用于单一实例),这将很可能永远是案例。

I could pass arguments when opening the application (seems a bit of a hacky way to do this though) but this wouldn't work when the application is already open (single instance only), which will more than likely always be the case.

我已经看到了一些东西,使用JavaScript /的ActiveX做,但这些链接会一直在一封电子邮件中在Outlook中我没有这种做法是可行的。

I've seen some stuff done with JavaScript / ActiveX but as these links will always be in an email in Outlook I don't that approach would work.

所有正在使用Windows 7和.NET 4.1的机器

All the machines are using Windows 7 and .Net 4.1

推荐答案

请参阅控制面板项目默认程序,然后选择设置关联(制作的文件类型或协议(例如as.mp3或http ://)在一个特定的程序一直开着的)

See the control panel item "Default Programs" and then "Set Associations" ( "Make a file type or protocol (such as.mp3 or http://) always open in a specific program" )

这些是通过注册表项(其可以使用安装完成)来设置。你打通整个URL作为第一个参数,所以你需要选择这家公寓。

These are set through registry keys (which can be done with an installer). You get through the entire url as your first argument, so you will need to pick this apart.

请参阅文档:

http://msdn.microsoft .COM / EN-US /库/ IE / aa767914(V = vs.85)的.aspx

有注册表键和一个简单的演示程序的例子。

There are examples of the registry keys and a simple demo program.

有关参考,注册表项的结构是这样的:

For reference, the registry key is structured like this:

HKEY_CLASSES_ROOT 
   myapp
      (Default) = "URL:MyApp Protocol"
      URL Protocol = ""
      DefaultIcon
           (Default) = "myapp.exe,1"
      shell
           open
                command
                     (Default) = "C:\Program Files\WunderWurks\myapp.exe" "%1"

一旦你设置了,您可以添加一个普通HTML链接到您的应用程序,如< A HREF =的myapp:one_two_three>点击此处< / A>

和您的应用程序将调用像程序myapp.exe one_two_three

And your app will get called like myapp.exe one_two_three

这篇关于从电子邮件超链接打开应用程序,并通过论证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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