菜鸟提问 不要笑

就是在 html里我设置个button 让他打开qq程序  可以吗???

解决方案 »

  1.   

    点击按钮 提交action到后台 运行java代码如下
    public class Exec {
        public static void main(String[] args) {
            try{
                    Process p=Runtime.getRuntime().exec
    ("c:\\Program Files\\Tencent\\QQ\\Bin\\QQ.exe");
    //这里是你的程序的绝对路径,你也可以将QQ路径加入到Path 环境变量里,可以直接运行exec("QQ");
              p.waitFor();
             }catch(Exception e){
             }
        }
    }
      

  2.   

    IE下用JS脚本打开QQ,路径中的空格要用%20<script> 
    function openQQ(){ 
                 var shell = new ActiveXObject("wscript.shell");
                 shell.run("file:///D:/Program%20Files/Tencent/QQ/Bin/QQ.exe"); 
            } </script> 
    <button onclick="openQQ();">打开QQ</button>
      

  3.   

    js打开,也只是在知道你本地QQ位置的情况下打开,让别人访问就没用了,好像没什么意义哦