通用网页调用本地应用程序方案(windows平台)
一、更新注册表
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\receiveOutOfArg]
"URL Protocol"="D:\\LongHaibin\\Learn\\Net\\receiveOutOfArg\\receiveOutOfArg\\bin\\Debug\\receiveOutOfArg.exe"
@="applicationName"
[HKEY_CLASSES_ROOT\receiveOutOfArg\DefaultIcon]
@="D:\\LongHaibin\\Learn\\Net\\receiveOutOfArg\\receiveOutOfArg\\bin\\Debug\\receiveOutOfArg.exe,1"
[HKEY_CLASSES_ROOT\receiveOutOfArg\shell]
[HKEY_CLASSES_ROOT\receiveOutOfArg\shell\open]
[HKEY_CLASSES_ROOT\receiveOutOfArg13:14 2017/5/11\shell\open\command]
@="\"D:\\LongHaibin\\Learn\\Net\\receiveOutOfArg\\receiveOutOfArg\\bin\\Debug\\receiveOutOfArg.exe\" \"%1\""
说明:
- applicationName:表示网页打开时提示的名称
- "%1":表示要传递的参数,只是%1,\":表示的是转义字符
二、创建一个应用
以下是c#应用程序的代码: 入口位置:
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args));
}
}
窗体代码:
public partial class Form1 : Form
{
private string[] args; public Form1(string[] args)
{
this.args = args;
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
this.label1.Text = string.Join(",", this.args);
}
}
三、创建一个网页
网页用a标签调用即可:
<a href="receiveOutOfArg://abc">open</a>
通用网页调用本地应用程序方案(windows平台)的更多相关文章
- html网页调用本地exe程序的实现方法:
html网页调用本地exe程序的实现方法:1.新建注册表具体文件: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\hhtpexe] [ ...
- PHP 网页调用本地exe程序实例
一.需求:在做网站的时候,有些网站网页面需要调用本地的exe程序. 二.方法:利用注册URL Protocol的方式. 代码如下: 1.视图文件里面的代码: <a href="fyex ...
- html网页调用本地exe程序的实现方法(转)
https://blog.csdn.net/ilovecr7/article/details/46803711 最近在做一个项目,要什么网页里调exe...开始以为不能实现,后来想想很多就跟淘宝网页上 ...
- Js调用exe程序方法(通过URL Protocol实现网页调用本地应用程序)
1.使用记事本(或其他文本编辑器)创建一个protocal.reg文件,并写入以下内容 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROO ...
- html网页调用本地exe程序
1.使用记事本(或其他文本编辑器)创建一个protocal.reg文件,并写入以下内容 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\ ...
- 利用URL Protocol实现网页调用本地应用程序
http://blog.csdn.net/zssureqh/article/details/25828683
- 网页调用本地程序(Windows下浏览器全兼容)
用网页调用本地应用程序的思路是,先进行注册表注册自定义一个URL Protocol协议,再利用URL Protocol实现网页调用本地应用程序. 1.先写一个注册表文件,将其保存为.reg后缀的注册表 ...
- PC网页js调用本地应用程序
最近要现实一个在PC网页中实现点击按钮调用本地应用程序的功能 其实实现原理也非常简单, 首先注册一个本地注册表文件,指向本地应用程序路径 其次在网页中用js指向这个注册表文件,就可以实现网页调用本地应 ...
- js网页中调用本地应用程序
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta http-equiv="Con ...
随机推荐
- Python封装:实现输出一个文件夹下所有各个文件的地址存为列表集合内——Jason niu
def getAllImages(folder): assert os.path.exists(folder) assert os.path.isdir(folder) imageList = os. ...
- idea通过mapper快速定位到xml文件
1.点击File找到设置(Settings) 2.点击Plugins下的 Browse respositories 3.在搜索栏搜索mybatis ,选中 Free Mybatis plugin——i ...
- (一)stm32f103~~GPIO基本操作一(led灯)
GPIO基本操作,如果更换IO口只需要更换端口设置即可 led.h文件 #ifndef __LED_H #ifndef __LED_H #define __LED_H #include "s ...
- 简单使用WebSocket实现聊天室
环境需求:flask,websocket第三方包 目录结构 web中实现群聊 ws_群聊.py文件 # 实现一个websocket 先下载包 gevent-websocket from flask i ...
- linux仅修改文件夹权限 分别批量修改文件和文件夹权限
比如我想把/var/www/html下的文件全部改成664,文件夹改成775,怎么做呢 方法一: 先把所有文件及文件夹改成664,然后把所有文件夹改成775 chmod -R 664 ./ find ...
- [POJ2259]Team Queue (队列,模拟)
2559是栈,2259是队列,真的是巧啊 题意 模拟队列 思路 水题 代码 因为太水,不想打,发博客只是为了与2559照应,于是附上lyd的std #include <queue> #in ...
- maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ...
- mysql import error
mysql导入文件一直出错,显示ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option s ...
- centos7搭建本地 Remix
由于最近要弄加入某联盟链,是基于ETH 所以要弄一个开发环境 一.准备 安装 nodejs,npm,git 二.安装 git clone https://github.com/ethereum/rem ...
- [LeetCode] Score of Parentheses 括号的分数
Given a balanced parentheses string S, compute the score of the string based on the following rule: ...