This is one easy way you can do it
It creates a socket and then read line by line until the end of the file.
import java.io.*;
import java.net.*;
public class Driver
{
public static void main(String[] args) throws IOException
{
URL site = new URL("http://www.thegate.nu/uptime.php");
URLConnection con = site.openConnection();
BufferedReader data = new BufferedReader(new InputStreamReader(con.getInputStream()));
String d = data.readLine();
while(d != null)
{
System.out.println(d);
d = data.readLine();
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.