Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler  http://www.sina.com.cn");

解决方案 »

  1.   

    String myURL = "http://www.sohu.com";
            Runtime rt = Runtime.getRuntime();
            try {
                Process p = rt.exec("C:/Program Files/Internet Explorer/iexplore "
                        + myURL);
                p.waitFor();
            } catch (Exception E) {
                System.out.println(E.getMessage());
                E.printStackTrace();
            }其中使用了绝对地址。
      

  2.   

    或者
    Runtime.getRuntime().exec("explorer.exe http://www.sina.com.cn");
      

  3.   

    try{
    Runtime run = Runtime.getRuntime();
             run.exec("c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE http://www.sina.com.cn");

    }catch(Exception e){
          System.out.println(e.getMessage());
    }
      

  4.   

    to:kingfish(八百里秦川@龙城异客) 请问在linux下面怎么做呀?
      

  5.   

    try{
    Runtime run = Runtime.getRuntime();
             run.exec("mozilla http://www.sina.com.cn");

    }catch(Exception e){
          System.out.println(e.getMessage());
    }
      

  6.   

    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler  http://www.sina.com.cn");
    这种写法没用过,有什么不同和优点么?
      

  7.   

    rundll32.exe是windows自带的一个工具,看看名字就能猜到意思了
    举个例子
    //打开控制面板的"日期和时间"
    rundll32.exe shell32.dll,Control_RunDLL timedate.cpl rundll user,exitwindowsexec
    ...
      

  8.   

    to:kingfish(八百里秦川@龙城异客)
    to:bluesmile979(笑着) 请问在Mac下面怎么做呀?我这几个平台的都要用,谢谢了
      

  9.   

    mac没用过应该差不多, 把explorer.exe换成mac下的浏览器软件
      

  10.   

    Runtime.getRuntime().exec("explorer.exe http://www.sina.com.cn");
      

  11.   

    路过
    学习ing
    谢谢楼上得各位大哥,大姐得不吝赐教
    谢谢楼主得问题
      

  12.   

    Runtime.getRuntime().exec("explorer.exe http://www.sina.com.cn");