在Java,后台中,怎通过后台的一个function打开一个本地的一个html页面呢 ? 之前我用了Runtime.getRuntime().exec(file );貌似这个只能打开的是.exe文件,对html不起作用啊

解决方案 »

  1.   

    Runtime.getRuntime().exec("iexplore d:\xxxx.html");
    试试
      

  2.   


    不行,还是报这个错:Cannot run program "iexplore": CreateProcess error=2, ?????????
      

  3.   

    如果不加 iexplore 的话就报这个错:Cannot run program "D:\1.html": CreateProcess error=193, %1 ??????Ч?? Win32 ??ó
      

  4.   

    Runtime.getRuntime().exec("C:\\Program   Files\\Internet   Explorer\\IEXPLORE.EXE   www.sina.com.cn");哥们 这是在google上找到的  原来我也没接触过   我想你应该先学着自己用 google了 她才是最好的帮手
      

  5.   


    羞愧啊!哥们说的是!google搜索还不到家,之前没搜到。也是用Runtime.getRuntime().exec("IEXPLORE.EXE  www.sina.com.cn");但这个不行,没找到ie的路径。
      

  6.   

    这个函数应该可以打开的,可能是你的路径名有问题(比如有些有空格),
    Runtime.getRuntime().exec("cmd /c\"F:\\游戏\\hello.html\"");照着这个试试,应该可以了
      

  7.   

    恩是路径的问题..Runtime.getRuntime().exec("C:\\Program  Files\\Internet  Explorer\\IEXPLORE.EXE  F:\\游戏\\hello.html");这样是可以的
      

  8.   

    Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE F:\\游戏\\hello.html");如何指定宽度及高度啊……