Output webpage content : Web Crawler : Network C# Source Code


Custom Search

C# Source Code » Network » Web Crawler »

 

Output webpage content








    



using System.Net;
using System;
using System.IO;
public class WebPagesApp {
    [STAThread]
    public static void Main(string[] args) {
        string s = "http://www.microsoft.com";
        Uri uri = new Uri(s);
        WebRequest req = WebRequest.Create(uri);
        WebResponse resp = req.GetResponse();
        Stream str = resp.GetResponseStream();
        StreamReader sr = new StreamReader(str);

        string t = sr.ReadToEnd();
        int i = t.IndexOf("<HEAD>");
        int j = t.IndexOf("</HEAD>");
        string u = t.Substring(i, j);
        Console.WriteLine("{0}", u);
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» Web Crawler