URLŬ·¡½º¸¦ ÀÌ¿ëÇØ¼ ÀÚºÏÀÇ index.htmlÆÄÀÏÀ» °¡Á®¿À´Â ¿¹Á¦
URLTest.java
import java.net.*;
import java.io.*;
public class URLTest {
public static void main(String args[]) {
try {
URL home = new URL("http://www.jabook.org:80/index.html");
BufferedReader br;
String line;
System.out.println("Port: "+home.getPort());
System.out.println("Protocol: "+home.getProtocol());
System.out.println("HostName: "+home.getHost());
System.out.println("File: "+home.getFile());
System.out.println("Ref: "+home.getRef());
br = new BufferedReader(new InputStreamReader(home.openStream()));
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
} catch (Exception e) {
System.out.println("Exception: " + e);
}
}
}
<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>
URLŬ·¡½º´Â À¥»ó¿¡ Á¸ÀçÇÏ´Â ÀÚ¿ø¿¡ Á¢±ÙÇϰųª, ³×Æ®¿öÅ© »óÀÇ À¯ÀÏÇÑ ÁÖ¼Ò¸¦ ³ªÅ¸³»´Â Ŭ·¡½ºÀÌ´Ù.
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è¿Ï±â |