URLŬ·¡½º·Î ƯÁ¤ È£½ºÆ®ÀÇ ½ºÆ®¸²À» ¹Þ¾Æ³»´Â ¿¹Á¦
URLConnectionRead.java
import java.net.*;
import java.io.*;
public class URLConnectionRead {
public static void main(String[] args) throws Exception {
URL ocu = new URL("http://www.jabook.org/");
URLConnection con = ocu.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
C:\javaExample\16>javac URLConnectionRead.java
C:\javaExample\16>java URLConnectionRead
<html>
<head>
<title>JABOOK(ÀÚºÏ)-ÀÚ¹Ù ¼Ò¼³°°Àº ÀÚ¹Ù º¸¼® ÀÚ¹Ù »þÂî ÀÚ¹Ù ¼Ò¼³ ÀÚ¹Ù ¼Ò¼³ C# 1ºÎ
¼Ò¼³ C# 2ºÎ ¼Ò¼³ C# 3ºÎ ¼Ò¼³ C# 4ºÎ</title>
</head>
<frameset rows="100,*" frameborder=0 border=0>
<frame src="head.html" name="menuhead" scrolling="no" marginwidth="0
" marginheight="0" target="_self" noresize>
<frame name="down" src="intro.html" scrolling="auto">
</frameset>
</html>
URLConnectionŬ·¡½º´Â Application°ú URL °£ÀÇ Åë½Å¸µÅ©¸¦ À§ÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è¿Ï±â |