Open/Read Test : WebClient : Network C# Examples


C# Examples » Network » WebClient »

 

Open/Read Test









    
using  System;
using  System.IO;
using  System.Net;

class  MainClass  
{
      public  static  void  Main(string[]  argv)
      {
            WebClient  wc  =  new  WebClient();
            string  response;

            Stream  strm  =  wc.OpenRead("http://www.navioo.com");

            StreamReader  sr  =  new  StreamReader(strm);

            while(sr.Peek()  >  -1)
            {
                  response  =  sr.ReadLine();
                  Console.WriteLine(response);
            }
            sr.Close();
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» WebClient