输入网址,返回该url的源代码的java程序怎么写??

[复制链接]
查看11 | 回复3 | 2011-2-10 09:25:51 | 显示全部楼层 |阅读模式
public static String getURLSource(String link, String encoding) throws Exception {
URL link = new URL(url);
BufferedReader br = new BufferedReader(new InputStreamReader(link.openStream(), encoding));
StringBuffer sb = new StringBuffer(2048);
String tmp = br.readLine();
while (tmp != ...
回复

使用道具 举报

千问 | 2011-2-10 09:25:51 | 显示全部楼层
public static void main(String[] args) throws Exception {PostMethod httppost = null;HttpClient httpclient = new HttpClient();httpclient.getParams().setSoTimeout(10 * 60...
回复

使用道具 举报

千问 | 2011-2-10 09:25:51 | 显示全部楼层
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行