exe程序打包写入注册表URL启动

exe 打包工具VNIS将变异文件打包成一个安装文件

URL Protocal协议模板

Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\myprotocol]

@="myprotocol Protocol"

"URL Protocol"=""


[HKEY_CLASSES_ROOT\myprotocol\DefaultIcon]

@="D:\\CloudMusic\\cloudmusic.exe"


[HKEY_CLASSES_ROOT\myprotocol\shell]

@=""


[HKEY_CLASSES_ROOT\myprotocol\shell\open]

@=""


[HKEY_CLASSES_ROOT\myprotocol\shell\open\command]

@="\"D:\\CloudMusic\\cloudmusic.exe\" "

对应打包时的脚本

    WriteRegStr HKCR "myprotocol" "" "myprotocol Protocol"
    WriteRegStr HKCR "myprotocol" "URL Protocol" ""
    WriteRegStr HKCR "myprotocol\DefaultIcon" "" "$INSTDIR\GFF客户端.exe"
    WriteRegStr HKCR "myprotocol\shell" "" ""
    WriteRegStr HKCR "myprotocol\shell\open" "" ""
  WriteRegStr HKCR "myprotocol\shell\open\command" "" '"$INSTDIR\GFF客户端.exe" "%1"'

安装完成后注册表


TIM图片20180926094320.png

html url

<!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="myprotocol://123,123,123">

 执行可执行文件
  </a>
        
</div>
    
</body>

</html>

程序入口接收url参数

  private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if(args.Length >0)
            {
                for(int i =0; i< args.Length; i++)
                MessageBox.Show(args[i].ToString());
            }

通过url protocal 传参启动本地exe


TIM图片20180926094752.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,383评论 19 139
  • 写在开头 先说说为什么要写这篇文章, 最初的原因是组里的小朋友们看了webpack文档后, 表情都是这样的: (摘...
    Lefter阅读 5,425评论 4 31
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,245评论 6 342
  • 那些温暖的人和事儿D1 2018-04-02 by小水(深圳) 我的老板是个憨厚又很聪明非常耿直的直男,有时看到他...
    水水的微享空间阅读 192评论 0 0
  • (1)酣甜入梦乡: 神气复方3滴+野橘2滴 (2)聪慧天才: 迷迭香2滴+乳香2滴+薄荷2滴 (3)增加快乐: 乳...
    明莹阅读 3,025评论 0 2

友情链接更多精彩内容