Skip to content

Commit 241f85a

Browse files
Add files via upload
It is the HTTP Web Client Program to download a web page using TCP Socket.
0 parents  commit 241f85a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

HttpWebPage.java

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import java.net.*;
2+
import java.io.*;
3+
public class HttpWebPage
4+
{
5+
public static void main(String args[]) throws Exception
6+
{
7+
URL url=new URL(args[0]);
8+
InputStream is=url.openStream();
9+
DataInputStream dis=new DataInputStream(is);
10+
String s=" ";
11+
while ((s=dis.readLine())!=null)
12+
System.out.println(s);
13+
dis.close();
14+
is.close();
15+
}
16+
}

0 commit comments

Comments
 (0)