package main
import (
"fmt"
"time"
)
func main() {
for {
fmt.Println(time.Now())
time.Sleep(16 * time.Second)
}
}
go build -o MyApp.exe
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<a href="MyApp://">A</a>
</body>
</html>
注册表:MyApp.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTMyApp]
@="Open MyApp"
"URL Protocol"=""
[HKEY_CLASSES_ROOTMyAppshell]
[HKEY_CLASSES_ROOTMyAppshellopen]
[HKEY_CLASSES_ROOTMyAppshellopencommand]
@=""D:\test\a\MyApp.exe""
从浏览器启动应用程序 - Application URL - Ldlchina - 博客园 https://www.cnblogs.com/ldlchina/p/5045950.html
windows 用浏览器打开应用程序的方法_du_peiduo的专栏-CSDN博客_浏览器打开应用 https://blog.csdn.net/nothing_is_imposible/article/details/80405361
上面的 reg 文件编写原理其实就是参照能通过浏览器打开的程序的注册表修改的(比如:迅雷应用程序,win 键 + R > 输入 regedit 在注册表找到对应程序,导出即可)