日期:2014-05-18 浏览次数:20682 次
public static String getURLContent(String para){ String cont = null; InputStream reader = null; try { URL url = new URL(para); reader = url.openStream(); int i; StringBuffer content = new StringBuffer(); while((i = reader.read()) > -1) { content.append((char)i); } cont = content.toString(); } catch (Exception e) { e.printStackTrace(); }finally{ try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } return cont; }