Use WebClient to read website : WebClient : Network C# Examples


C# Examples » Network » WebClient »

 

Use WebClient to read website









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

class  MainClass
{
    [STAThread]
    static  void  Main(string[]  args)
    {
        WebClient  MyClient  =  new  WebClient();
        Stream  MyStream  =  MyClient.OpenRead("http://www.navioo.com");
        StreamReader  MyReader  =  new  StreamReader(MyStream);

        Console.WriteLine(MyReader.ReadLine());
        MyStream.Close();
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» WebClient