Use WebRequest : WebRequest : Network C# Examples


C# Examples » Network » WebRequest »

 

Use WebRequest









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

class  MainClass
{
    [STAThread]
    static  void  Main(string[]  args)
    {
        WebRequest  MyRequest  =  WebRequest.Create("http://www.navioo.com");
        WebResponse  MyResponse  =  MyRequest.GetResponse();
        Stream  MyStream  =  MyResponse.GetResponseStream();
        StreamReader  MyReader  =  new  StreamReader(MyStream);
        string  MyWebLine;

        while  ((MyWebLine  =  MyReader.ReadLine())  !=  null)
        {
            Console.WriteLine(MyWebLine);
        }

        MyStream.Close();
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» WebRequest