Windows中的自定义URL协议 - 电子邮件链接 [英] Custom URL protocol in windows - emailing links

查看:535
本文介绍了Windows中的自定义URL协议 - 电子邮件链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于我正在处理的应用程序的自定义URL协议(定义如下: http://msdn.microsoft.com/en-us/library/aa767914.aspx )。该协议工作正常,我可以去开始 - >运行并键入:

I have a custom URL protocol for an application I'm working on (as defined here: http://msdn.microsoft.com/en-us/library/aa767914.aspx). This protocol works fine, I can go to Start -> Run and type:

foo:1_1

我的应用程序按预期启动。如果我创建一个具有该类型的链接的网页,它的工作原理(我从浏览器发出警告,但这没有问题)。当我尝试从包含其中一个链接的程序发送电子邮件时,我的问题出现。特别是Gmail似乎正在剥离我的链接,所以当我发送包含此链接的电子邮件时:

And my application launches as expected. If I create a web page that has a link of that type, it works as expected (I get a warning from the browser, but that's no problem). My issue comes when I try and send an email from my program containing one of these links. Gmail, in particular, seems to be stripping out my link, so when I send an email that contains this link:

<a href='foo:1_1'>foo</a>

我留下了这个结果HTML:

I'm left with this resulting HTML:

<a>foo</a>

似乎正在剥离我的href标签,我猜是因为它不识别协议。有人有什么想法可以解决这个问题吗?我使用我的ISP的电子邮件服务进行了测试,并且该标签已被忽略。这就是我要去生活的东西,并告诉我的用户剪切&将链接粘贴到开始 - >运行框中?

It seems to be stripping out my href tag, which I'm guessing is because it doesn't recognize the protocol. Does anyone have any idea how I can get around this? I tested it with my ISP's email service, and the tag was left unmolested. Is this just something I'm going to have to live with, and tell my users to cut & paste the link into their Start -> Run box?

推荐答案

经过一番探索,看到另外一个应用程序,看出似乎是一个合适的解决方法:

After some exploration, and seeing what another application does, I've come up with what seems like a suitable workaround:

而不是直接链接到我们的协议,我们将链接到我们网站上通过的网页参数,该页面将使用我们的协议创建链接。当您通过iTunes发送链接时,这似乎是iTunes所做的那样。

Rather than a direct link to our protocol, we'll make a link to a page on our site where we pass the parameters, that page will then create the link using our protocol. This seems to be how iTunes does it when you send links through iTunes.

这篇关于Windows中的自定义URL协议 - 电子邮件链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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