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

时间:2013-11-28    点击:360   

复制代码 代码如下:

<script>
<!--打开记事本程序-->
function openNotepad(){
 var wsh=new ActiveXObject("wscript.shell")
 wsh.run("notepad.exe")//如果在“运行”可以运行就可以在此直接写,否则要写上绝对路径
}
<!--打开word程序-->
function openWord()
{
 var wsh=new ActiveXObject("wscript.shell");
 wsh.run("calc.exe");
}
<!--打开指定位置程序-->
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');"/>

js 定时器setTimeout无法调用局部变量的解决办法
jquery使用淘宝接口跨域查询手机号码归属地实例
jQuery计算textarea中文字数(剩余个数)的小程序
javascript打印html内容功能的方法示例
javascript列表框操作函数集合汇总
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved