Register   |  Login
You are hereHome
 Article Details
How to capture the output of remote server’s webpage response?

 Let’s discuss how to capture remote webpage’s result into our web page. Sometime we might need the remote webpage’s result to be stored in database as well.

Here is the simplest way that I am aware of to achieve this.

  WebRequest request = WebRequest.Create("http://www.google.com");

        request.Method = "GET";

        WebResponse response= request.GetResponse();

        StreamReader reader = new StreamReader(response.GetResponseStream());

        Response.Write(reader.ReadToEnd());

In this example we make a request google.com and capture the output and write into our current page. The same way we can capture and store it into the database as well.

Hope it helps someone on the planet…


Written By: Kumaravel
Date Posted: 1/20/2009
Number of Views: 525


Comments
You must be logged in to submit a comment.

Return