首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

JAVA每天一题17

2012-10-28 
JAVA每日一题17??? 题目:使用JAVA编写扫描网站信的代码,呵呵!import com.macfaq.net.* import java.net.*

JAVA每日一题17

??? 题目:使用JAVA编写扫描网站信的代码,呵呵!

import com.macfaq.net.*; import java.net.*; import java.io.*; public class useDirSearch {public static void main(String[] args) {String target = "";for (int i = 0; i < args.length; i++) {target += args[i] + " ";}target = target.trim( ); QueryString query = new QueryString("search", target); try {// 新建URL对象URL u = new URL("http://search.dmoz.org/cgi-bin/search?" +query); InputStream in = new BufferedInputStream(u.openStream( )); InputStreamReader theHTML = new InputStreamReader(in); int c; while ((c = theHTML.read( )) != -1) {System.out.print((char) c); }}// 处理异常catch (MalformedURLException e) {System.err.println(e); }catch (IOException e) {System.err.println(e); }}}

?

?

???

1 楼 hzpfly 2009-04-04   什么是网站信啊? 2 楼 hzpfly 2009-04-04   import com.macfaq.net.*;

没有见过啊,能不能介绍一下。 3 楼 shiyiwan 2009-04-06   为什么不用StringBuffer代替String 4 楼 foodyi 2009-04-07   希望楼主认真一些,这个程序要是没有编译错误我就吃了.
import com.macfaq.net 这个是自定义的包 里面包含QueryString类
你都没有给考全,哎

热点排行