腾讯官方通过 Tencent://Message/协议可以让QQ用户显示QQ/TM的在线状态发布在互联网上;并且点击 ,不用加好友也可以聊天:
官方链接: http://is.qq.com/webpresence/code.shtml
具体代码:
<a href="tencent://message/?uin=215555521&Site=JooIT.com&Menu=yes">
<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
|
分享到:
相关推荐
郁闷的很,干嘛还要描述。我看我就没的那天分。
腾讯云 NPM 镜像:https://mirrors.cloud.tencent.com/npm/ 华为云 NPM 镜像:https://mirrors.huaweicloud.com/repository/npm/ 网易 NPM 镜像:https://mirrors.163.com/npm/ 中科院大学开源镜像站:...
在Java中实现QQ强聊功能,首要的是理解网络编程的概念,特别是TCP/IP协议族的应用。TCP(传输控制协议)用于建立可靠的、双向的数据流连接,而IP(互联网协议)则负责数据在网络中的路由。在QQ聊天中,我们需要通过...
维泰QQ好友营销软件,采用只能防骚扰策略,只给久未联系的QQ好友发送消息。时间可以自定义,每次发送熟练可自定义。 维泰QQ好友营销软件说明: 完全模拟人工操作,给QQ好友群发消息; 采用只能防骚扰策略,只给久...
2020年7月份特斯拉Model 3及比亚迪新能源汽车销量均实现过万,分别达到1.1万辆和0.9万辆,环比增长9.0%。中汽协数据显示,7月份国内新能源汽车产销量分别达到10万辆和9.8万辆,同比分别增长15.6%和19.3%。这一变化...
在引用通过intent跳转到手机QQ聊天界面的DEMO
PyTorch是一款流行的深度学习...在安装过程中遇到问题,可以参考<https://cloud.tencent.com/developer/article/1877178> 和<https://blog.csdn.net/weixin_42069606/article/details/1051988> 这样的资源进行解决。
该论文详细介绍了PV-RCNN 的算法原理和实现细节。 PV-RCNN 的代码可以在github上找到,地址是https://github.com/open-mmlab/OpenPCDet。OpenPCDet 是一个基于 PyTorch 的三维目标检测框架,提供了 PV-RCNN 等多种...
<li><a target=blank href=tencent://message/?uin=12345678&Site=大拇指&Menu=yes><img src="images/1_m.gif" width="20" height="20" /> 在线交谈</a></li> <li><a target=blank href=tencent://message/?uin=...
通过分析和理解这个源代码,我们可以深入探究聊天应用的工作原理,学习网络通信、多用户同步、消息推送等相关技术。 【描述】"一个类似QQ的聊天源代码"暗示了该源码包含实现即时通讯所需的关键组件,如用户注册与...
### 开始→运行→输入的命令集锦 在Windows操作系统中,“开始→运行”功能提供了一个快速执行系统命令、打开程序或访问特定设置界面的途径。以下是对该文本中的命令进行整理与解释: #### 1....
腾讯源:http://mirrors.cloud.tencent.com/pypi/simple 华为镜像源:https://repo.huaweicloud.com/repository/pypi/simple/ 1 2 3 4 5 6 7 8 9 10 11 12 13 1、临时使用 pip install [包名] -i [pip源URL] # ...
图书管理系统,C:\Users\ASUS\Documents\Tencent Files\879188838\FileRecv,C:\Users\ASUS\Documents\Tencent Files\879188838\FileRecv
这篇http://blog.csdn.net/ichliebephone/archive/2010/12/31/6110519.aspx博文中用到的文件。
com.tencent.mobileqq_TMAssistantDownloadSDKService.21.04.14.10.qlog
_storage_emulated_0_android_data_com.tencent.mobileqq_Tencent_QQfile_recv_.TbsReaderTempcom.tencent.mobileqq_83ca8a5fc862397bd03b8fa8d9944926.dat
选择了阿里云视觉智能开放平台(https://vision.aliyun.com/)、百度AI开放平台...//cloud.tencent.com/)、讯飞开放平台(https://www.xfyun.cn/)、华为云(https://developer.huaweicloud.com/)等主流的国内AI平台
com.tencent.mobileqq.21.03.26.23.qlog
大家也许会被一些假像所迷惑,也许会认为 QQ 的 HTTP 服务器是基于 80 口进行通信的(如:218.17.209.23: 80) ,其实不然,正真基于 HTTP 的服务器应该是:http: //tqq.tencent.com:8000, 它是一个通过 8000 口...