Tencent://Message/协议

news/2024/11/6 5:12:43/
腾讯官方通过 Tencent://Message/协议可以让QQ用户显示QQ/TM的在线状态发布在互联网上;并且点击 XXX ,不用加好友也可以聊天
官方链接: http://is.qq.com/webpresence/code.shtml

具体代码:
| < img border="0" SRC='http://wpa.qq.com/pa?p=1:215555521:3' alt="点击这里给我发消息"> < /a> |

| 但它是如何实现的呢?下面文章以及微软官方说明详细解释了其工作原理: |
|
| 微软官方说明:http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/appendix_a.asp |
| Register protocol,此文中对于 Windows、Linux 和 OS X 操作系统如何注册协议都有说明。比如说 Windows,其实只需写入注册表,即可实现协议与执行程序的关联。例如腾讯的Tencent://Message协议注册表如下:
| [HKEY_CLASSES_ROOT\TENCENT] @=”TencentProtocol” “URL Protocol”=”D:\Program Files\Tencent\QQ\Timwp.exe” |
| [HKEY_CLASSES_ROOT\TENCENT\DefaultIcon] @=”D:\Program Files\Tencent\QQ\Timwp.exe,1″ |
| [HKEY_CLASSES_ROOT\TENCENT\shell] |
| [HKEY_CLASSES_ROOT\TENCENT\shell\open] |
| [HKEY_CLASSES_ROOT\TENCENT\shell\open\command] @=”\”D:\Program Files\Tencent\QQ\Timwp.exe\” \”%1\”" |
| 此注册表所实现的就是当浏览器(或其它)碰到 tencent://… 时,自动调用 Timwp.exe,并把 tencent://… 地址作为第一个参数传递给 Timwp.exe。 |
| 更多参见:Registering an Application to a URL Protocol。 |
| 附:原文 |
| 程序代码: |
| A protocol is a method that is used to send, receive, and handle information over a connection. Common protocols viewed from the browser include http, ftp, and mailto. In order for you to view information sent over a specific protocol, it must be registered. Once registered, the protocol can then be handled by the program you specify, such as your browser or a 3rd party viewer. This means that a hyperlink ( e.g. foo://fred ) can use the handler for protocol foo to open the file named fred. |
| Contents [hide] 1 Registering an unsupported protocol 1.1 Windows 1.2 Linux 1.3 OS X 2 Redirecting a registered protocol |
| [edit]Registering an unsupported protocol Mozilla products utilize protocols defined internally, as well as those defined by the operating system. You can add the ability to use an unsupported protocol by registering it. The OS-specific method of doing this is described below. |
| [edit]Windows Create the registry .reg file, replacing foo with your unregistered protocol, and the path with whatever handler program you want to run. Then merge it into the Windows registry. |
| REGEDIT4 |
| [HKEY_CLASSES_ROOT\foo] @="URL:foo Protocol" "URL Protocol"="" |
| [HKEY_CLASSES_ROOT\foo\shell] |
| [HKEY_CLASSES_ROOT\foo\shell\open] |
| [HKEY_CLASSES_ROOT\foo\shell\open\command] @=""C:\Program Files\Application\program.exe" "%1"" See Registering an Application to a URL Protocol for additional information. |
| [edit]Linux Registration is unnecessary. Simply associate whatever proto: with a program through Firefox: Example: Add the sip: protocol to launch kphone for VoIP calls in Firefox: |
| - Type about:config into the address bar - Right-click create new boolean value: network.protocol-handler.external.sip and set to true - Right-click create new boolean value: network.protocol-handler.warn-external.sip and set to false - Right-click create new string value: network.protocol-handler.app.sip and set to /usr/bin/kphone This will actually launch kphone. Not sure if it will dial though. That is untested 😃 |
| You can also optionally register the protocol with whatever window manager you are using. In KDE this is done through Control Center - KDE Components - File Associations. This step is usually unnecessary unless your window manager has a custom browser, such as konqueror. |
| [edit]OS X Probably very similar to Linux (above). |
| [edit]Redirecting a registered protocol If the protocol is already handled by the browser, you can specify what program will be used as a handler to open the file. To do this, add the pref: network.protocol-handler.app.foo as a string with value C:\Program Files\Application\program.exe Note: If the path or name is incorrect, the browser will display an error saying "protocol (foo) isn't associated with any program". (See bug 312953). |
| You may also need to use the following prefs, although this is uncertain: network.protocol-handler.external.foo = true network.protocol-handler.expose.foo = false |


http://www.ppmy.cn/news/601547.html

相关文章

Tencent SSL 数字证书安装部署

目录 前言一、SSL 证书购买二、配置监听器三、Nginx SSL 配置FAQ 前言 之前写了一篇关于 SSL 证书的文章《Nginx 自签证书实现80转443》&#xff0c;不过这是自签证书的形式进行部署的&#xff0c;尽管能正常访问&#xff0c;但依然显示是不安全的&#xff0c;因为自签证书是得…

QQ的Tencent://Message/协议

QQ即时聊天代码 *********为QQ号码 以前这样写&#xff1a;http://wpa.qq.com/msgrd?V1&Uin*********&Sitehexun.com/ngdao&Menuyes" 现在这样写&#xff1a;tencent://message/?uin*********&Sitehexun.com/ngdao&Menuyes tencent://message/?…

com.tencent.tinker.build.util.TinkerPatchException:

Execution failed for task :app:tinkerPatchRelease. > com.tencent.tinker.build.util.TinkerPatchException: There are fatal reasons that cause Tinker interrupt patch generating procedure, see logs above. 错误记录下面是log日志 打补丁包一直没有成功 &#xf…

关于腾讯的Tencent://Message/协议

我们知道&#xff0c;很多网站的在线QQ客服是通过 Tencent://Message/协议实现的&#xff0c;类似的实现还有迅雷、快播...下载链接等。 那么这是什么原理呢&#xff1f; 经过一番google&#xff0c;博主发现&#xff1a; 微软官方说明&#xff1a;http://msdn.microsoft.com…

开源推荐,腾讯正式开源 Spring Cloud Tencent

一、为什么要做 Spring Cloud Tencent Spring Boot Spring Cloud 仍是 Java 生态最主流的框架 2014 年 4 月 Spring Boot 发布 1.0 版本&#xff0c;经过 8 年时间的发展&#xff0c;Spring Boot 已然成为 Java 开发框架的事实标准。在分布式微服务领域&#xff0c;2016 年 …

手动集成Tencent SDK遇到的坑!!!

手动集成的原因 由于腾讯未把Tencent SDK上传到Github中&#xff0c;所以我们不能通过Cocoapods的方式集成&#xff0c;只能通过官方下载其SDK手动集成。 Tencent SDK手动集成步骤 1.访问腾讯开放平台SDK下载界面&#xff0c;找到并下载iOS_SDK_V3.5.1。&#xff08;目前最新…

Econ3116-econ5116-week5知识点精讲-规模经济、垄断竞争与贸易

对本文有疑问可以加微信 Tutor_0914联系。也可以访问我的个人辅导网站 &#xff1a; tutoryou 总结 这节课的topic本人总结如下&#xff1a; 了解规模经济、垄断竞争和贸易之间的关系&#xff0c;以及如何用垄断竞争模型分析国际贸易的影响 了解生产者异质性、垄断竞争和贸易…

将win上的文件传输到Ubuntu虚拟机

首先获取Ubuntu系统的ip地址&#xff0c;在Ubuntu的Terminal中输入ifconfig&#xff0c;可以看到Ubuntu的ip地址 可以看到我电脑的ip地址是10.0.2.15。更改虚拟机的网络连接 这里以VirtualBox为例&#xff0c;打开VirtualBox设置&#xff0c;选择网络&#xff0c;将连接方式改…