[´ë´ä]Á¦°¡ ¹¯°í Á¦°¡ ´äÇϳ׿ä. Á» ÀÌ»óÇÏ´Ù(souce code Æ÷ÇÔ)


[ Follow Ups ] [ Post Followup ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

Posted by ¹ÚÁø¿ì on April 18, 1997 at 01:08:57:

In Reply to: [Áú¹®] html ¹®¼­¸¦ ÆĽÌÇÏ°í ½Í½À´Ï´Ù. posted by ¹ÚÁø¿ì on April 16, 1997 at 22:20:17:

/*Çѹø ´õ »ý°¢Çغ¸°í ÀÌ°÷¿¡ ¿Ã·Á¾ß µÇ°Ú³×¿ä...
±×·¸°Ô ¾î·ÆÁö ¾ÊÀº °Å¿´´Âµ¥.
ÇѼû ÀÚ°í ³ª´Ï±î °©Àڱ⠻ý°¢ ³ª³×¿ä.. ÂÁ.
index·Î ÁÙ ¹®ÀÚ¿­À» "http:" ·Î ÁÖ´Ï±î ¹Ù·Î µÇ³×¿ä.
°ü½ÉÀÌ ÀÖÀ¸½Ã´Ù¸é ¾Æ·¡ ¼Ò½º Äڵ带 Çѹø µ¹·Áº¸¼¼¿ä.
*/
import java.net.*;
import java.io.*;
import java.util.*;

class MindsTest
{
public static void main(String[] args)
{ Vector vt = new Vector();
try
{ URL yahoo = new URL("http://www.yahoo.com");
URLConnection yahooConnection = yahoo.openConnection();
DataInputStream dis = new DataInputStream(yahooConnection.getInputStream());
String url;
String line;

while((line = dis.readLine()) != null)
{ int index1 = 0;
int index2 = 0;
if((index1 = line.indexOf("http:")) != -1)
{ index2 = line.indexOf(">", index1);
url = line.substring(index1, index2-1);
vt.addElement(url);
}
}
dis.close();
System.out.println(vt.toString());
vt.removeAllElements();
}
catch (MalformedURLException me)
{ System.out.println("MalformedURLException");
}
catch(IOException ie)
{ System.out.println("I/O Error");
}
}
}


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]