Reading Web Pages from a Uri : Uri : Network C# Examples


C# Examples » Network » Uri »

 

Reading Web Pages from a Uri









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


class  MainClass
{
        public  static  void  Main(string[]  args)
        {
                Uri  uri  =  new  Uri("http://www.navioo.com");
                
                
                WebRequest  req  =  WebRequest.Create(uri);
                WebResponse  resp  =  req.GetResponse();
                Stream  stream  =  resp.GetResponseStream();
                StreamReader  sr  =  new  StreamReader(stream);
                
                string  s  =  sr.ReadToEnd();
                
                Console.WriteLine(s);

        }
}
    
   
  
   



Output


     Java examples (example source code) Organized by topic 

...
...


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» Uri