81,092
社区成员
发帖
与我相关
我的任务
分享
public static void test3() throws IOException {
URL url = new URL("http://www.hrtsea.com/down/soft/45.htm");
//返回一个 URLConnection 对象,它表示到 URL 所引用的远程对象的连接。
URLConnection uc = url.openConnection();
//打开的连接读取的输入流。
InputStream in = uc.getInputStream();
int c;
while ((c = in.read()) != -1)
System.out.print(c);
in.close();
}