四海人民公摄 - 海外华人摄影爱好者论坛

 找回密码
 注册
搜索
热搜: 活动 交友 discuz
查看: 1276|回复: 0

How to run programs from a web page

[复制链接]
发表于 2012-4-13 11:51:30 | 显示全部楼层 |阅读模式
  1. <script>
  2. function LaunchApp(AHUdb) {
  3.         if (!document.all) {
  4.             netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
  5.             var file = Components.classes["@mozilla.org/file/local;1"]
  6.             .createInstance(Components.interfaces.nsILocalFile);
  7.             file.initWithPath(AHUdb);
  8.             file.launch();
  9.           return;
  10.         }
  11.         
  12.         var ws = new ActiveXObject("WScript.Shell");
  13.         ws.run(AHUdb);
  14. }
  15. </script>


  16. <a href="javascript:LaunchApp('C:\\TheFolder\\TheProgram.exe')">Click here to Execute your file</a>
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|四海人民公摄 - 海外华人摄影爱好者网站

GMT+8, 2024-5-3 19:44

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表