private static String getStaticPage(String surl) {
String htmlContent =
try {
java
nnect();
inputStream = connection
byte bytes[] = new byte[
int index =
int count = inputStream
while (count !=
index += count;
count = inputStream
}
htmlContent = new String(bytes
connection
} catch (Exception ex) {
ex
}
return htmlContent
}
String src= getStaticPage(
File file = new File(
FileWriter resultFile = new FileWriter(file);
PrintWriter myFile = new PrintWriter(resultFile);
//寫文件
myFile
resultFile
myFile
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26121.html