±Û¾´ÀÌ :°í¼º±º 1998³â 10¿ù 07ÀÏ 09:53:28
URL Class ¸¦ ÀÌ¿ëÇÏ¿© ƯÁ¤ Web Page¿¡¼ ¹®¼¸¦ °¡Á®¿À¸é
ÇѱÛÀÌ ±úÁ®¼ Ãâ·ÂµË´Ï´Ù...
ÀÌ·± °æ¿ì ¾î¶»°Ô ó¸® ÇؾßÁÒ....
Source)
import java.net.*;
import java.io.*;
import java.util.*;
class URLOpen {
public static void main(String[] args) {
try {
String inputLine;
// www.naver.com Home Page Open
URL naver = new URL("http://www.naver.com/");
DataInputStream dis = new DataInputStream(naver.openStream());
while ((inputLine = dis.readLine()) != null) {
System.out.println(inputLine);
}
dis.close();
} catch (MalformedURLException me) {
System.out.println("MalformedURLException: " + me);
} catch (IOException ioe) {
System.out.println("IOException: " + ioe);
}
}
}