import java.io.*;
import java.net.*;
public class test {
public static void main(String args[]){
try{
URL u=new URL("http://127.0.0.1");
URLConnection uc=u.openConnection();
InputStream raw=uc.getInputStream();
InputStream buffer=new BufferedInputStream(raw);
//
Reader r=new InputStreamReader(buffer);
int c;
while((c=r.read())!=-1){
System.out.print((char) c);
} //end while
}//end try
//catch (MalformedURLConnection e){
// System.err.println("cannot connect");
// }
catch (IOException e){
System.err.println(e);
}// end catch
}// end main
}//end test
凡是有该标志的文章,都是该blog博主Caoer(草儿)原创,凡是索引、收藏
、转载请注明来处和原文作者。非常感谢。