网站首页 > 易语言相关 > 易语言常见问题及笔记 正文
腾讯官方通过 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。
附:原文
程序代码:
[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
- 上一篇: 易语言人脸识别支持库
- 下一篇: 男子“自学成才” 变身黑客网上盗窃
猜你喜欢
- 2022-02-26 QQ安卓协议_最新版本8.8.68_wtlogin.login _recv分析
- 2022-02-25 QQ安卓协议_最新版本8.8.68_wtlogin.login _send分析
- 2020-08-13 DIY属于自己的鼠标侧键
- 2020-04-12 win7对硬盘进行bitlocker解锁后再上锁
- 2020-04-12 windows 环境如何启动 redis ?
- 2020-04-12 MySQL之长连接、短连接、连接池
- 2020-04-12 雷电模拟器,fiddler抓不了包,
- 2020-04-12 sql where id大于小于
- 2020-04-12 读取CSV文件内容到列表框
- 2020-04-12 SQL一些知识点
你 发表评论:
欢迎- 百度站内搜索
- 关注微信公众号
- 网站分类
-
- 网站公告
- 电子书书籍
- 程序员工具箱
- 编程工具
- 易语言相关
- 网络相关源码
- 图形图像源码
- 系统工具源码
- 易语言模块源码
- 易语言支持库
- 数据库类源码
- 易语言例程
- 易语言游戏开发
- 易语言模块
- 多媒体类源码
- 易语言资源网
- 易语言视频教程
- JS分析教程
- 易语言图文教程
- 易语言常见问题及笔记
- 工具源码
- 易语言版本
- 网络编程
- javascript
- PHP编程
- html
- 正则表达式
- 面试题
- nodejs
- 其它综合
- 脚本专栏
- python
- 按键精灵相关
- 按键精灵图文教程
- 按键精灵视频教程
- 按键精灵Q语言
- 按键精灵安卓版
- golang
- 游戏安全
- 火山相关
- 火山安卓软件
- 火山常见问题及笔记
- 火山安卓源码
- 火山视频教程
- 火山PC版本下载
- 火山PC视窗例程
- 互联网那些事
- 引流推广
- 项目揭秘
- 网络营销
- 营销软件
- QQ营销软件
- 娱乐软件
- 机器人插件
- 培训教程
- 技术教程
- 活动线报
- 数据库
- Redis
- Access
- MongoDB
- Mysql
- 问答
- 其它
- 易语言
- 需求
- 在线教程
- 多线程培训班
- 觅风易语言教程
- 模拟系列教程
- 集中营易语言教程
- 历史数据
- 随机tag
已有5位网友发表了看法:
三叶博客 评论于 [2018-10-07 09:09:49] 回复
TENCENT协议原理
访客 评论于 [2018-11-09 14:39:51] 回复
学习了
访客 评论于 [2018-11-09 14:41:21] 回复
感谢博主分享
易语言资源网站 评论于 [2019-03-21 09:35:04] 回复
tencent://
易语言模块 评论于 [2020-06-08 15:49:24] 回复
易語言 tencent://message协议返回值