?? readurltest.java
字號:
import java.io.*;
import java.net.*;
public class ReadUrlTest {
public static void main (String[] args) {
try {
URL u = new URL ("http://www.tsinghua.edu.cn:80/chn/index.html");
InputStream is = u.openStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String theLine;
while ((theLine = br.readLine()) != null) {
System.out.println (theLine);
}
}
catch (MalformedURLException e) {
System.err.println (e);
}
catch (IOException e) {
System.err.println (e);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -