window系统下浏览器打开本地应用

1、需要打开本地程序的安装路径为

    D:\\Tencent\\WeChat\\WeChat.exe\

2、写注册表文件

[code="js"] Windows Registry Editor Version 5.00  
  
[HKEY_CLASSES_ROOT\wechat]  
@="微信"  
"URL Protocol"=""  
  
[HKEY_CLASSES_ROOT\wechat\DefaultIcon]  
@="WeChat.exe,1"  
  
[HKEY_CLASSES_ROOT\wechat\shell]  
  
[HKEY_CLASSES_ROOT\wechat\shell\open]  
  
[HKEY_CLASSES_ROOT\wechat\shell\open\command]  
@="\"D:\\Tencent\\WeChat\\WeChat.exe\" \"%1\""  

 

3、保存文件wechat.reg,打开注册表(regedit在打开中输入快捷命令),导入wechat.reg

4、在浏览器中调用window.location = "Wechat://parameters"   parameters可选



 

猜你喜欢

转载自dangdang520.iteye.com/blog/2391098
今日推荐