import java.net.*; import java.io.*; public class ReadDemo { public static void main(String argv[]) { try { URL url = new URL("http://blog.chinaunix.net/u/15586/showart_1863289.html"); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String str; while((str = in.readLine()) != null) System.out.println(str); in.close(); } catch(MalformedURLException e){} catch(IOException e) {} } } 本文来自: (www.91linux.com) 详细出处参考:http://www.91linux.com/html/article/program/java/20090314/16092.html