通过ActiveX执行文件
生活随笔
收集整理的這篇文章主要介紹了
通过ActiveX执行文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
??? <title>無標題頁</title>
??? <script type="text/vbscript">
??????? function?? run_file()?
???? Set?? objShell=CreateObject("WScript.Shell")???
???? objShell.Run?? "C:\Inetpub\wwwroot\RegexTester.exe",1,FALSE???
???? Set?? objShell?? =?? Nothing???
???? end?? function
??? </script>
?<SCRIPT?? language=JavaScript>?
? function?? Run(strPath)?? {?
??
? try?? {?
? var?? objShell?? =?? new?? ActiveXObject("WScript.Shell");?
? objShell.Run(strPath);?
? objShell?? =?? null;?
? }?
? catch?? (e){alert('找不到文件"'+strPath+'"(或它的組件之一)。請確定路徑和文件名是否正確,而且所需的庫文件均可用。')?
??
? }?
? }?
? </SCRIPT>
</head>
<body>
??? <input id="Button1" type="button" value="button" οnclick="run_file()" /><br />
<input id="Button1" type="button" value="button" οnclick='Run("C:\Inetpub\wwwroot\RegexTester.exe")' />
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
??? <title>無標題頁</title>
??? <script type="text/vbscript">
??????? function?? run_file()?
???? Set?? objShell=CreateObject("WScript.Shell")???
???? objShell.Run?? "C:\Inetpub\wwwroot\RegexTester.exe",1,FALSE???
???? Set?? objShell?? =?? Nothing???
???? end?? function
??? </script>
?<SCRIPT?? language=JavaScript>?
? function?? Run(strPath)?? {?
??
? try?? {?
? var?? objShell?? =?? new?? ActiveXObject("WScript.Shell");?
? objShell.Run(strPath);?
? objShell?? =?? null;?
? }?
? catch?? (e){alert('找不到文件"'+strPath+'"(或它的組件之一)。請確定路徑和文件名是否正確,而且所需的庫文件均可用。')?
??
? }?
? }?
? </SCRIPT>
</head>
<body>
??? <input id="Button1" type="button" value="button" οnclick="run_file()" /><br />
<input id="Button1" type="button" value="button" οnclick='Run("C:\Inetpub\wwwroot\RegexTester.exe")' />
</body>
</html>
轉載于:https://www.cnblogs.com/virusswb/archive/2008/05/05/1183484.html
總結
以上是生活随笔為你收集整理的通过ActiveX执行文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java.util.concurrent
- 下一篇: 配置silverlight 2的开发环境