这样可以打开IE浏览器 但是怎么样能吧url 地址传给程序 也就是说打开指定的url地址呢?
public void run()
  {try
    {
    Process p = null;
    p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE);
    p.waitFor();
    }catch(Exception e1)
    {System.out.println("Error executing notepad");
    }
  }
---------------------------------------------------
参数怎么传递?

解决方案 »

  1.   

    public void run()
      {try
        {
        Process p = null;
        p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE  www.sohu.com");//直接加在后面就行了
        p.waitFor();
        }catch(Exception e1)
        {System.out.println("Error executing notepad");
        }
      }
    --------------------------------------------------------
    但是这样调用cmd和 telnet有问题public void run()
      {try
        {
        Process p = null;
      //p = Runtime.getRuntime().exec("c:\\windows\\system32\\cmd.exe");// 有问题
      //p = Runtime.getRuntime().exec("c:\\windows\\system32\\telnet.exe"); // 有问题    p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE);
        p.waitFor();
        }catch(Exception e1)
        {System.out.println("Error executing notepad");
        }
      }