Advertisement
Advertisement
| 05.29.2008 at 05:06AM PDT, ID: 23441078 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class Trial {
public static void main(String[] args)
{
try
{
URL PageUrl;
URLConnection GetConn = null;
GetConn = null;
PageUrl = new URL("http://www.google.com");
GetConn = PageUrl.openConnection();
//establish connection:
//GetConn.connect();
//save privacy policy source file into text file
System.out.println(GetConn.getURL());
System.out.println("----");
System.out.println(GetConn.getInputStream());
System.out.println("----***");
InputStreamReader ReadIn = new InputStreamReader(GetConn.getInputStream());
}catch(IOException io)
{
System.out.println(io);
}
}
}
|