chrome网页中打开exe
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VMS]
@="URL:VMS"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\VMS\DefaultIcon]
@="chrome.exe,1"
[HKEY_CLASSES_ROOT\VMS\shell]
[HKEY_CLASSES_ROOT\VMS\shell\open]
[HKEY_CLASSES_ROOT\VMS\shell\open\command]
@="E:\\Debug\\CameraPlayer.exe %1"
以上内容另存为WebCall.reg,替换最后一行为实际要打开的exe文件全路径 最后的%1代表参数
双击导入注册表
网页中加入
<a href="VMS://uuid,admin,张三"> vms </a>
浏览网页 点击超链接即可打开exe
程序中接受传递的值
Main函数中
MessageBox.Show(e.Args.Length + "|" );
if (e.Args.Length > 0)
{
string arg = e.Args[0];
string para = arg.Substring(arg.IndexOf(":")+1, arg.Length- arg.IndexOf(":") -1);
string[] params= para.Split(',');
}
作者:xuejianxiyang
出处:http://xuejianxiyang.cnblogs.com
关于作者:Heaven helps those who help themselves.
本文版权归原作者和博客园共有,欢迎转载,但未经原作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。