1、首先需要先写一个注册表文件;
通过txt文本写,写完以后更改后缀名:longzhoufeng.reg;
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\longzhoufeng]
@="longzhoufeng Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\longzhoufeng\DefaultIcon]
@="C:\\Program Files (x86)\\MarkdownPad 2\\MarkdownPad2.exe"
[HKEY_CLASSES_ROOT\longzhoufeng\shell]
@=""
[HKEY_CLASSES_ROOT\longzhoufeng\shell\open]
@=""
[HKEY_CLASSES_ROOT\longzhoufeng\shell\open\command]
@="\"C:\\Program Files (x86)\\MarkdownPad 2\\MarkdownPad2.exe\" "
2、在html代码中加入
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<div>
<a href="longzhoufeng://">
执行可执行文件
</a>
</div>
</body>
</html>