HTTP URLConnection
代码块
try {
URL u = new URL("http://www.greenpeace.org/");
URLConnection uc = u.openConnection( );
}
catch (MalformedURLException ex) {
System.err.println(ex);
}
catch (IOException ex) {
System.err.println(ex);
}
try {
URL u = new URL("http://www.greenpeace.org/");
URLConnection uc = u.openConnection( );
}
catch (MalformedURLException ex) {
System.err.println(ex);
}
catch (IOException ex) {
System.err.println(ex);
}