日期:2014-05-17 浏览次数:20769 次
try {//117.79.91.231 URL l_url = new URL(url); HttpURLConnection l_connection = (HttpURLConnection)l_url.openConnection(); l_connection.connect(); InputStream l_urlStream = l_connection.getInputStream(); BufferedReader l_reader = new BufferedReader(new InputStreamReader(l_urlStream)); String sCurrentLine = " "; String sTotalString = " "; while((sCurrentLine = l_reader.readLine()) != null) { sTotalString+=sCurrentLine; } System.out.println(sTotalString); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }