admin管理员组

文章数量:1566854

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

}

参考1:https://blog.csdn/mr_wanter/article/details/52784958
它的教程存在问题:缺少:

[HKEY_CLASSES_ROOT\VMS]
@="URL:VMS"
"URL Protocol"=""

本文标签: 浏览器程序chromeexe