zoukankan      html  css  js  c++  java
  • Javascript 调用active文件

    <!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/javascript">
            function Run(strPath) {
                txtExe.value = strPath;
                try {
                    var objShell = new ActiveXObject("wscript.shell");
                    objShell.Run(strPath);
                    objShell = null;
                }
                catch (e) {
                    alert('找不到文件"' + strPath + '"(或它的组件之一)。请确定路径和文件名是否正确,而且所需的库文件均可用。')
                }
            } 
        </script>
    </head>
    <body>
        请输入要运行的程序:<br>
        <input name="txtExe" type="text" size="20" value="regedit">
        <button type="button" onclick="Run(txtExe.value)">
            确定</button>
        <button type="button" onclick="txtExe.value=''">
            重新输入</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\system32\\otepad.exe')">
            记事本</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\system32\\mspaint.exe')">
            画图板</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\system32\\calc.exe')">
            计算器</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\system32\\cmd.exe')">
            cmd</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\egedit.exe')">
            注册表</button><br>
        <button type="button" onclick="Run('C:\\WINDOWS\\PCHealth\\HelpCtr\\Binaries\\msconfig.exe')">
            Msconfig</button><br>
    </body>
    </html>
  • 相关阅读:
    C#异步编程:多线程基础Thread类
    WPF:TextBox控件禁用中文输入
    C#:泛型的协变和逆变
    C#:泛型接口
    C#:泛型委托
    C#:泛型类
    Jetbrains Rider:缺少.NET Framework 4.5.2
    C#:泛型方法
    C#:泛型
    C#:接口
  • 原文地址:https://www.cnblogs.com/zhangchenliang/p/1791118.html
Copyright © 2011-2022 走看看