Save web page from HttpWebResponse : Web Client : Network C# Source Code


Custom Search

C# Source Code » Network » Web Client »

 

Save web page from HttpWebResponse








    


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

public class WebApp {
    public static void Main() {
        String page = "http://www.yoursite.net/index.html";
        HttpWebRequest site = (HttpWebRequest)WebRequest.Create(page);
        HttpWebResponse response =(HttpWebResponse)site.GetResponse();
        Stream dataStream = response.GetResponseStream();
        StreamReader read = new StreamReader(dataStream);
        String data = read.ReadToEnd();
        Console.WriteLine(data);
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» Web Client