在网页中调用本地的应用程序

0 views
Skip to first unread message

sky

unread,
Jun 20, 2006, 11:09:11 PM6/20/06
to Net Express
例子:


<script>
function exec (command) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('命令' + window._command + '
已经被用户禁止!');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
</script>

<input type=button onclick="exec('notepad')" value=执行>

Reply all
Reply to author
Forward
0 new messages