/// Author: Francis A. Shanahan /// http://www.FrancisShanahan.com using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net; using System.IO; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void cmdGo_Click(object sender, EventArgs e) { // Create a request using the URI specified in the form HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(this.txtUri.Text); // Send the request and get a response object back HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); // Obtain the ResponseStream from the Response object Stream myResponseStream = myResponse.GetResponseStream(); // Create a reader for the response stream StreamReader myReader = new StreamReader(myResponseStream); // Read the stream from start to finish and display the results this.myLiteral.Text = myReader.ReadToEnd(); } }