1
A
回答
1
您需要查看使用緩衝閱讀器並使用Java中的URL對象。
它基本上是這樣的:
URL url = new URL("http://myurl.com");
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String input = "";
while((input = reader.readLine())!=null) {
System.out.println(input);
}
+0
感謝您的幫助 – htw 2012-03-28 22:19:33
1
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL oracle = new URL("http://www.oracle.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(oracle.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
相關問題
- 1. 在鉻上打開網址
- 2. Fab打開網址
- 3. 打開網址開頭鉻://
- 4. 鈦打開新的網址
- 5. 在Android應用中打開網址?
- 6. 如何在UIWebview中打開YouTube網址?
- 7. 打開網址使用Delphi
- 8. 從CSV打開網址
- 9. iPhone:打開網址編程
- 10. 打開網址發送POST
- 11. 打開網址處理
- 12. 用cmd打開網址
- 13. 遠程打開網址
- 14. 使用javascript打開網址
- 15. h打開網址:selectOneMenu
- 16. 在打開的購物車中將舊的網址重定向到新網址
- 17. 網址未在iPhone上打開
- 18. 網址未在iPad上打開
- 19. 的JavaScript打開URL與類的網址
- 20. 從文本中查找網址並在新標籤中打開該網址
- 21. 如何在驗收驗收測試中打開網址/網頁?
- 22. 從今天的分機打開網址
- 23. iOS處理打開的網址swift
- 24. 網址無法打開與webdriver的
- 25. 如何在javascript中的新窗口中打開top.location.href網址
- 26. 我的硒不會打開網址只需打開火狐
- 27. 在php中打開兩個動作網址,在oscommerce中支付
- 28. 打開網址而無需在Chrome擴展程序中打開標籤頁?
- 29. 錯誤的網址格式?頁面不會在tomcat中打開
- 30. 在我的應用程序中打開視頻網址
BlueJ的只是一個IDE,你編程的語言是Java。 – 2012-03-28 21:23:50
看看=> http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html – 2012-03-28 21:25:04
感謝您的幫助 – htw 2012-03-28 22:18:39