在网页上放置一个 button或者 <a></a>,点击的时候能够打开本机上的指定的exe
   比如点击网页上的
     <a>开始扫雷游戏</a>
     点击后,打开运行本地 的 扫雷.exe。希望高手给个 简单的实例,代码中包含必要的注释。

解决方案 »

  1.   

    听说要 做个ActiveX控件,望有经验的大侠不吝赐教
      

  2.   

    听说要 做个ActiveX控件,望有经验的大侠不吝赐教
      

  3.   

    办法非常多,JS是其中一个:
    var Shell=new ActiveXObject("WScript.Shell"); 
    try { var kk="xxx.exe"; 
    var aa=Shell.Run(kk,1,true); 
      

  4.   

    使用activex控件,安全性问题
    http://clchun.javaeye.com/blog/719333
      

  5.   

     /// <summary>   
        /// 从CMD运行里面启用服务   
        /// </summary>   
        /// <param name="sender"></param>   
        /// <param name="e"></param>   
        protected void Button4_Click1(object sender, EventArgs e)   
        {   
             //开启服务   
            ProcessStartInfo a = new ProcessStartInfo(@"c:\windows\system32\cmd.exe","/c  net start 服务名");   
            a.WindowStyle = ProcessWindowStyle.Hidden;   
            Process process = Process.Start(a);   
               
               
        }   
        protected void Button5_Click1(object sender, EventArgs e)   
        {   
             //关闭服务   
            ProcessStartInfo a = new ProcessStartInfo(@"c:\windows\system32\cmd.exe","/c  net stop 服务名");   
            a.WindowStyle = ProcessWindowStyle.Hidden;   
            Process process = Process.Start(a);   
               
               
        }   
        protected void Button6_Click1(object sender, EventArgs e)   
        {   
              ProcessStartInfo a = new ProcessStartInfo(@"D:\\zhengxinle\\xiangmu\\NetView\\NetView\\Transmit.exe" ,"-install");   
            Console.Write("安装服务成功");   
            a.WindowStyle = ProcessWindowStyle.Hidden;   
            Process process = Process.Start(a);   
    }   
      
        protected void Button7_Click1(object sender, EventArgs e)   
        {   
              ProcessStartInfo a = new ProcessStartInfo(@"D:\\zhengxinle\\xiangmu\\NetView\\NetView\\Transmit.exe" ,"-remove");   
            Console.Write("卸载服务成功");   
            a.WindowStyle = ProcessWindowStyle.Hidden;   
            Process process = Process.Start(a);   
    }  
      

  6.   


    例如打开qqprotected void Button6_Click1(object sender, EventArgs e)   
      {   
      ProcessStartInfo a = new ProcessStartInfo(@"D:\\QQ.exe" ,"-install");   
      Console.Write("成功");   
      a.WindowStyle = ProcessWindowStyle.Hidden;   
      Process process = Process.Start(a);   
    }   
      

  7.   


    你看清楚呗,我是在cmd里面启用和安装服务   cmd里面打开一个exe不是小菜!    这是看明白了就知道了!
      

  8.   

    服务器端cmd这么高级能开客户端exe。
      

  9.   

     Process proc = new Process();
                proc.StartInfo.FileName = @"C:\Program Files\Tencent\QQ\Bin\QQ.exe"; 
                proc.StartInfo.Arguments = ""; 
                proc.Start();已测命名空间 using System.Diagnostics;
      

  10.   

    想干坏事?
    web程序不可能执行客户端的exe程序
    除非你能忽悠别人装你的activex
      

  11.   

    我查看了文章,请问第7步的“添加新Windows安装项目 winsetup”怎样弄,我找不到“Windows安装项目 winsetup”第七步:发布。添加新Windows安装项目 winsetup   添加项目主输出,然后,改动ActiveX控件的主输出文件,将其Register属性改为vsdrpCOM,很遗憾的是,安装URL 中必须使用绝对路径,不能使用相对路径。这意味着生成安装程序的时候就必须确定路径,不是很方便。
       
      

  12.   

    这个exe是本地已经有的呀,就是客户端已经安装了的exe