HttpWebRequest.GetResponse()
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);
}
}
Related examples in the same category