/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.URL; import java.net.URLConnection; public class Test { /** * @param args */ try { conn.setDoOutput(true); in = url.openStream(); e.printStackTrace(); } } if(charset==null||"".equals(charset)){ charset="utf-8"; } while ( (rLine = bReader.readLine()) != null) { int str_len = tmp_rLine.length(); if (str_len > 0) { s.append(tmp_rLine); pw.println(tmp_rLine); pw.flush(); } tmp_rLine = null; } in.close(); pw.close(); return s.toString(); } }
URL: http://www.zhuoda.org/lunzi/90049.html