浏览器-启动本地程序

Posted jffun-blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了浏览器-启动本地程序相关的知识,希望对你有一定的参考价值。

(未完成)

使用自定义的协议打开应用程序

  1. 编写程序
    将test.exe保存到c盘根目录
#include <stdio.h>
int main(int argc, char** argv)
{
    int i;
    printf("hello world!
");
    for (i = 0; i < argc; ++i)
    {
        printf("argv[%d] = %s
", i, argv[i]);
    }
    getchar();
    return 0;
}
  1. 注册表里添加协议
    test.reg保存到c盘根目录,并双击运行
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT	est-url-protocol]
"URL Protocol"="c:\test.exe"
@="fooProtocol"
[HKEY_CLASSES_ROOT	est-url-protocolshell]
[HKEY_CLASSES_ROOT	est-url-protocolshellopen]
[HKEY_CLASSES_ROOT	est-url-protocolshellopencommand]
@=""c:\test.exe" "%1""
  1. 浏览器中测试
    浏览器地址栏输入test-url-protocol://xxx(xxx是参数)



以上是关于浏览器-启动本地程序的主要内容,如果未能解决你的问题,请参考以下文章

chrome浏览器插件启动本地应用程序

Android小部件,启动一个片段?

浏览器-启动本地程序

浏览器-启动本地程序

微信小程序json数据如何处理?

选择片段 A 时如何在 ViewPager 上不一起启动所有片段