答案:import java.net.*;
import java.io.*;
import java.util.*;
public class ReadURLFile{
public static void main(String[] args) throws Exception{
URL urlfile = new URL("http://192.168.16.34/xuys/index_.html");
BufferedReader in = new BufferedReader(new InputStreamReader(urlfile.openStream()));
String content="";
String inputLine = in.readLine();
while(inputLine!=null){
content += inputLine;
inputLine = in.readLine();
}
System.out.println(content);
in.close();
}
}
上一个:实例学习Spring和Hibernate的一点点体会
下一个:看看对话框