源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

JavaScript调用客户端的可执行文件(示例代码)

  • 时间:2020-11-05 20:38 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:JavaScript调用客户端的可执行文件(示例代码)
[u]复制代码[/u] 代码如下:
<script> [b]<!--打开记事本程序--> [/b]function openNotepad(){  var wsh=new ActiveXObject("wscript.shell")  wsh.run("notepad.exe")//如果在“运行”可以运行就可以在此直接写,否则要写上绝对路径 } [b]<!--打开word程序--> [/b]function openWord() {  var wsh=new ActiveXObject("wscript.shell");  wsh.run("calc.exe"); } [b]<!--打开指定位置程序--> [/b]function openTxt(file) {  var wsh=new ActiveXObject("wscript.shell");  wsh.run(file); } </script> <input type="button" id="notepad" value="Notepad" onclick="openNotepad();"/> <input type="button" id="word" value="word"  onclick="openWord();"/> <input type="button" id="word" value="word"  onclick="openTxt('c://caipiao.txt');"/>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部