⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlreader.java

📁 URL programming. This example illustrates using a URL to access resources on a secure site.
💻 JAVA
字号:
import java.net.*;import java.io.*;/*  * This example illustrates using a URL to access resources * on a secure site. * * If you are running inside a firewall, please also set the following * Java system properties to the appropriate value: * *   https.proxyHost = <secure proxy server hostname> *   https.proxyPort = <secure proxy server port> *  */public class URLReader {    public static void main(String[] args) throws Exception {	System.setProperty("http.proxyHost", "193.226.5.55");    System.setProperty("http.proxyPort", "3128");	URL url = new URL("http://www.yahoo.com/");	BufferedReader in = new BufferedReader(				new InputStreamReader(				url.openStream()));	String inputLine;	while ((inputLine = in.readLine()) != null)	    System.out.println(inputLine);	in.close();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -