码迷,mamicode.com
首页 > Web开发 > 详细

url protocol

时间:2019-10-10 10:44:29      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:csharp   version   com   运行   class   registry   editor   protocol   def   

url protocol

让浏览器运行本地的EXE程序。例如:点击浏览器的一个下载链接,就会打开本地的迅雷。

1)注册表注册

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\yn]
"URL Protocol"="D:\\1.exe"
@="WebshellProtocol"
[HKEY_CLASSES_ROOT\yn\DefaultIcon]
@="D:\\1.exe,1"
[HKEY_CLASSES_ROOT\yn\shell]
[HKEY_CLASSES_ROOT\yn\shell\open]
[HKEY_CLASSES_ROOT\yn\shell\open\command]
@="\"D:\\1.exe\" \"%1\""

  2)编辑HTML

<html>
<head></head>
<body>
<a href=‘yn:hello‘>Open exe</a>
</body>
</html>

 3)DELPHI程序

procedure TForm16.FormCreate(Sender: TObject);
begin
   label3.Caption:=‘传入的参数是:‘+ParamStr(1);  // yn:hello
end;

  

 

url protocol

标签:csharp   version   com   运行   class   registry   editor   protocol   def   

原文地址:https://www.cnblogs.com/hnxxcxg/p/11646013.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!