日期:2014-05-16 浏览次数:20338 次
public static void main(String[] args) throws MalformedURLException { URL url=null; URLConnection conn=null; try { url = new URL("http://www.163.com"); conn = url.openConnection(); System.out.println("Open "+ conn.getURL()+ " is OKey!"); } catch (Exception e) { e.printStackTrace(); } try { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+"http://www.hao123.com" ); } catch (IOException e) { e.printStackTrace(); } }