using System; using System.Net.Sockets; using System.IO; namespace SocketTest { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { try { TcpClient socket = new TcpClient ("kahuna.clayton.edu", 80); NetworkStream ns = socket.GetStream(); StreamWriter sw = new StreamWriter (ns); StreamReader sr = new StreamReader (ns); sw.WriteLine("GET /index.html \n\n"); sw.Flush(); String response = ""; while (response != null) { response = sr.ReadLine(); Console.WriteLine(response); } } catch{ } Console.ReadLine(); } } }