zoukankan      html  css  js  c++  java
  • 从web启动winform程序

    最近有个客户提出想从网站上启动一个客户端的程序,研究了下,实现方法如下:

    1. 注入注册表

    //create registry key for web launch
    
    string appPath = """ + Application.ExecutablePath + "" "%1"";
    
    string subKey = Application.ProductName + "\shell\open\command";
    
    var newKey = Registry.ClassesRoot.CreateSubKey(subKey);
    
    newKey.SetValue(null, appPath);

    注入后效果如下图:

    image

    %1是传入的参数

    2. 网站上加一个link

    <a href="HelloWorld://123">Hello World</a>

    这里123是传入的参数

    image

    当我们点击这个link时,就会自动打开这个客户端软件。

  • 相关阅读:
    vim技巧2
    vim技巧1
    网站压力测试工具
    CentOS mysql安装
    破解root
    渐进式性能监测案例
    网络监测介绍
    I/O检测介绍
    虚拟内存介绍
    @Slf4j
  • 原文地址:https://www.cnblogs.com/jameslif/p/4101407.html
Copyright © 2011-2022 走看看