日期:2014-05-18 浏览次数:20696 次
// 获得html模板
public static String getHtml(String urlpath) {
StringBuffer sb = new StringBuffer();
try {
URL url = new URL(urlpath);
BufferedReader br = new BufferedReader(new InputStreamReader(
url.openStream()));
String s = null;
while ((s = br.readLine()) != null) {
sb.append(s);
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();
}