网页调用本地windows应用例子

来源:互联网 发布:sql注入式攻击 编辑:程序博客网 时间:2024/05/21 12:42

1.注册hello_world.exe 应用处理 test:

Windows Registry Editor Version 5.00   [HKEY_CLASSES_ROOT\test]    //创建注册表的路径@="URL:test Protocol"      //对应一条数据 默认  reg_sz URL:test Protocol"URL Protocol"=""           //对应一个key为URL Protocol的条目,其他为空[HKEY_CLASSES_ROOT\test\DefaultIcon]   @="hello_world.exe,1"             //对应一条数据 默认  reg_sz hello_world.exe,1[HKEY_CLASSES_ROOT\test\shell]      //创建目录[HKEY_CLASSES_ROOT\test\shell\open]  //创建目录[HKEY_CLASSES_ROOT\test\shell\open\command]  //创建目录@="cmd /c set m=%1 & call set m=%%m:test:=%% & call \"E:\\hello\\Debug\\hello_world.exe\" %%m%% & exit"  //在command目录下,写一个条目 。这个条目的内容为 使用 E:\\hello\\Debug\\hello_world.exe应用打开test:开头的路径

将上述内容(删除掉后面的注释),保存为1.reg文件。
点击,修改注册表。
2.使用网页发起test:请求

<!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="test:">点击调用本地hello_world应用</a>          </div>    </body></html>

将上述内容保存为网页,然后点击调用本地文件。
3.最基本的是,你要编写hello_world.exe应用。

转载地址:https://www.cnblogs.com/itljf/p/5859435.html

原创粉丝点击