简单的说
在没有任何前提条件下
我知道一个网页的URL 怎样才能得到该页面所显示的内容?`比如  我现在想得到 163主页 所显示的内容(当然,这个``内容比较多```打个比方而已~~~~)
请教了!谢谢

解决方案 »

  1.   

    import java.net.URL;
    import java.io.*;public class DownLoad{
    public static void main(String[] args){
         try{
         URL url = new URL("http://www.163.com");
         FileOutputStream out = new FileOutputStream("163.txt");
         InputStream in = url.openStream();
         int i = in.read();
         while(i != -1){
         out.write(i);
         i = in.read();
         }
         in.close();
         out.close();
         }catch(Exception e){
         e.printStackTrace();
         }
        }
    }