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(',');

}

 

From:https://www.cnblogs.com/xuejianxiyang/p/10828106.html

posted @ 2019-05-07 21:08  Ace001  阅读(4067)  评论(1编辑  收藏  举报