You are on page 1of 1

/** * @(#)javanetwork.java * * javanetwork application * * @author * @version 1.00 2012/2/20 */ import java.io.*; import java.net.*; import java.util.

Properties; import java.lang.*; public class javanetwork { public static void main(String[] args) { try{ System.setProperty("http.proxyHost", "172.16.13.17"); System.setProperty("http.proxyPort", "8080"); URL urlobject=new URL("http://www.google.com"); URLConnection connectionobj=urlobject.openConnection(); BufferedReader in=new BufferedReader(new InputStreamReader(connectionobj.ge tInputStream())); String inputline; while((inputline=in.readLine())!=null) System.out.println(inputline); in.close(); } catch(Exception e) { System.out.println("Error"); } } }

You might also like