JAVAÅÀ³æ
ÕâÊÇÒ»¸öwebËÑË÷µÄ»ù±¾³ÌÐò£¬´ÓÃüÁîÐÐÊäÈëËÑË÷Ìõ¼þ£¨ÆðʼµÄURL¡¢´¦ÀíurlµÄ×î´óÊý¡¢ÒªËÑË÷µÄ×Ö·û´®),
Ëü¾Í»áÖð¸ö¶ÔInternetÉϵÄURL½øÐÐʵʱËÑË÷,²éÕÒ²¢Êä³öÆ¥ÅäËÑË÷Ìõ¼þµÄÒ³Ãæ¡£ Õâ¸ö³ÌÐòµÄÔÐÍÀ´×Ô¡¶java±à³ÌÒÕÊõ¡·£¬
ΪÁ˸üºÃµÄ·ÖÎö£¬Õ¾³¤È¥µôÁËÆäÖеÄGUI²¿·Ö£¬²¢ÉÔ×÷ÐÞ¸ÄÒÔÊÊÓÃjdk1.5¡£ÒÔÕâ¸ö³ÌÐòΪ»ù´¡£¬¿ÉÒÔд³öÔÚ»¥ÁªÍøÉÏËÑË÷
ÖîÈçͼÏñ¡¢Óʼþ¡¢ÍøÒ³ÏÂÔØÖ®ÀàµÄ“ÅÀ³æ”¡£
ÏÈÇë¿´³ÌÐòÔËÐеĹý³Ì£º
D:\java>javac SearchCrawler.java£¨±àÒ룩
D:\java>java SearchCrawler http://127.0.0.1:8080/zz3zcwbwebhome/index.jsp 20 java
Start searching...
result:
searchString=java
http://127.0.0.1:8080/zz3zcwbwebhome/index.jsp
http://127.0.0.1:8080/zz3zcwbwebhome/reply.jsp
http://127.0.0.1:8080/zz3zcwbwebhome/learn.jsp
http://127.0.0.1:8080/zz3zcwbwebhome/download.jsp
http://127.0.0.1:8080/zz3zcwbwebhome/article.jsp
http://127.0.0.1:8080/zz3zcwbwebhome/myexample/jlGUIOverview.htm
http://127.0.0.1:8080/zz3zcwbwebhome/myexample/Proxooldoc/index.html
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=301
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=297
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=291
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=286
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=285
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=284
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=276
http://127.0.0.1:8080/zz3zcwbwebhome/view.jsp?id=272
ÓÖÈ磺
D:\java>java SearchCrawler http://www.sina.com 20 java
Start searching...
result:
searchString=java
http://sina.com
http://redirect.sina.com/WWW/sinaCN/www.sina.com.cn class=a2
http://redirect.sina.com/WWW/sinaCN/www.sina.com.cn class=a8
http://redirect.sina.com/WWW/sinaHK/www.sina.com.hk class=a2
http://redirect.sina.com/WWW/sinaTW/www.sina.com.tw class=a8
http://redirect.sina.com/WWW/sinaUS/home.sina.com class=a8
http://redirect.sina.com/WWW/smsCN/sms.sina.com.cn/ class=a2
http://redirect.sina.com/WWW
Ïà¹ØÎĵµ£º
ÒòΪÔÚ×öÁ´½ÓÀ´Ô´Í³¼ÆµÄʱºòÐèÒª°Ñ http://www.baidu.com/baidu?word= ... B%F7&tn=myie2dg ÕâÀàµÄURL±àÂ뻹ԳÉÃ÷ÎÄ×Ö´®£¬Ò»°ã´ó²¿·ÖµÄÍøÕ¾¶¼ÊÇÓÃÆÕͨµÄURL±àÂëÐÎʽ£¬ÈçÉÏÃæÁ´½ÓÖеÄbadu£¬ÕâÖַdz£ÈÝÒ×ת»»ºÍ»¹Ô£¬Java°üÀïÌṩÁËÁ½¸öÀàµÄ²»Í¬·½·¨URLEncode.encode()ºÍURLDecode.decode()Äܷdz£·½±ãʵÏÖ£¬µ ......
/**
* Ö±½Ó²åÈëÅÅÐò,Ê×ÏȱȽÏa[n]Óëa[n-1]£¬ÔڱȽÏa[n]Óëa[n-2]
* */
public void sort0(double[] a){
for(int i = 0; i < a.length -1; i ++){
......
Class.forName(xxx.xx.xx) ·µ»ØµÄÊÇÒ»¸öÀà
Ê×ÏÈÄãÒªÃ÷°×ÔÚjavaÀïÃæÈκÎclass¶¼Òª×°ÔØÔÚÐéÄâ»úÉϲÅÄÜÔËÐС£Õâ¾ä»°¾ÍÊÇ×°ÔØÀàÓõÄ(ºÍnew ²»Ò»Ñù£¬Òª·ÖÇå³þ)¡£
ÖÁÓÚʲôʱºòÓã¬Äã¿ÉÒÔ¿¼ÂÇÒ»ÏÂÕâ¸öÎÊÌ⣬¸øÄãÒ»¸ö×Ö·û´®±äÁ¿£¬Ëü´ú±íÒ»¸öÀàµÄ°üÃûºÍÀàÃû£¬ÄãÔõôʵÀý»¯Ëü£¿Ö»ÓÐÄãÌáµ½µÄÕâ¸ö·½·¨ÁË£¬²»¹ýÒªÔÙ¼ÓÒ»µã¡£
A a = ......
¹ØÓÚJava
µÄµ×²ãÒ»Ö±Ïëдµãʲô£¬µ«ÊǺÃÏñºÜ¶àÎÊÌâÔÚÍøÉÏ»¹ÊÇ¿ÉÒÔÕҵõ½´ð°¸£¬×îºó»¹ÊǾö¶¨Ð´³öÀ´£¬Ò»À´¿ÉÒÔÈÃ×Ô¼ºÖØÎÂһϣ¬¶þÀ´¿ÉÒԺʹó¼ÒÒ»ÆðÉîÈë̽ÌֵײãµÄ֪ʶ¡£ÕâÀïÃ滹ÓÐһЩ³£¼ûµÄСÎÊÌ⣬Ҳ¸½´øÔÚÀïÃæµÄÔÒò£¬framework
ÆäʵҲÊǹ¹½¨ÔÚÕâЩ֪ʶµÄ»ù´¡Éϵġ£
ÂÛÒ»£ºÊýÖµÂÛ
ÎÊÌâÒ ......
4¡¢Ïú»Ù¶ÔÏó JavaÖв»ÐèÒª³ÌÐòÔ±×Ô¼ºÈ¥Ïú»Ù¶ÔÏó£¬ÕâÊÇΪʲôÄØ£¿ ÔÚC++ÖУ¬¶ÔÓÚ±äÁ¿¼°¶ÔÏóÉúÃüÖÜÆÚµÄά»¤Õ¼¾ÝÁË´óÁ¿µÄ±à³Ìʱ¼ä£¬ÒòΪ³ÌÐòÔ±ÐèÒªÖªµÀ±äÁ¿´æ»îµÄʱ¼ä£¬ÒÔ±ãÔÚÓÃÍêÖ®ºóÄÜ°ÑËüÏú»Ù£¬²»È»»áÕ¼ÂúÄÚ´æ¿Õ¼ä£¬×èÈû³ÌÐò¡£Òò´ËJavaÔÚÉè¼Æʱ¶Å¾øÁËÕâÒ»ÎÊÌâ¡£ÄÇôJavaÊÇÔõô×öµÄÄØ£¬¿´ÏÂÃæµÄ½éÉÜ¡£ 4.1¡¢±äÁ¿×÷ÓÃÓò ×÷ÓÃÓ ......