惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
D
DataBreaches.Net
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
F
Full Disclosure
V2EX - 技术
V2EX - 技术
N
News and Events Feed by Topic
Help Net Security
Help Net Security
L
LangChain Blog
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
B
Blog RSS Feed
N
Netflix TechBlog - Medium
N
News | PayPal Newsroom
TaoSecurity Blog
TaoSecurity Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
B
Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
AI
AI
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
G
GRAHAM CLULEY
Vercel News
Vercel News
罗磊的独立博客
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
C
CERT Recently Published Vulnerability Notes
GbyAI
GbyAI
Scott Helme
Scott Helme
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
A
About on SuperTechFans
P
Privacy International News Feed

博客园 - 锐

Windows7 Server 2008 下安装Oracle 10g提示“程序异常终止,发生未知错误”的解决方法 Android应用自动更新功能的代码实现 Undefined exploded archive location 项目不能部署 linux下mysql5.5.19编译安装笔记【已验证】 CSS+DIV排版时容器内对象全部设置了float属性后容器不能自动适应高度的解决方案 php Smarty模板生成html文档的方法 - 锐 - 博客园 如何解决Firefox检测不到div高度问题 DD_belatedPNG,解决IE6不支持PNG绝佳方案 .net程序运行在无.net framework环境中 struts2 freemarker当中引进java 常量java静态方法 - 锐 简体-繁体互转换的一个JS - 锐 - 博客园 Tencent://Message/协议的实现原理 - 锐 - 博客园 国内三大免费流媒体WAP门户网站(视频类WAP网站) C#中RSA加密解密和签名与验证的实现 (转) C#读取CPUid,硬盘id,网卡Mac地址 Struts2.1.6使用小技巧 java -D参数简化加入多个jar MySQL Proxy 学习笔记(转) 用apache ab做web压力测试
C#实现通过URL触发自己的程序
· 2010-07-15 · via 博客园 - 锐

实现原理:http://hi.baidu.com/wu1987116/blog/item/8352896056ea254deaf8f83e.html

本例功能:在IE访问baidu:内容时,将baidu:内容做为启动参数,执行ceshi.exe程序,在程序中将内容作为搜索

                内容,执行百度搜索

实现步骤:

在VS2005中新建Windows应用程序

在Program.cs文件的中的static void Main()

方法中加入代码:

static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (System.Environment.GetCommandLineArgs().Length > 1)             //如果有启动参数
            {
                string strCmd = System.Environment.GetCommandLineArgs()[1].ToLower();
                string startCmd = "http://www.baidu.com/s?wd=" + strCmd.Replace("baidu:", "");
                System.Diagnostics.Process.Start(startCmd);
            }
            else
            {
                MessageBox.Show("参数错误!", "提示");
            }
        }

生成exe文件

导入如下注册表信息:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\baidu]
@=""
"URL Protocol"=""

[HKEY_CLASSES_ROOT\baidu\Shell]

[HKEY_CLASSES_ROOT\baidu\Shell\Open]

[HKEY_CLASSES_ROOT\baidu\Shell\Open\Command]
@="D:\\ceshi.exe %1"

"D:\\ceshi.exe %1"    为生成的程序路径,

此注册表所实现的就是当浏览器(或其它)碰到 baidu:… 时,自动调用 ceshi.exe,并把 baidu:… 地址作为参数传递给 ceshi.exe,并通过ceshi.exe判断传入的参数格式,执行操作