How do i do two consecutive WebRequest.GetResponse ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • relikangus
    New Member
    • Nov 2009
    • 3

    How do i do two consecutive WebRequest.GetResponse ?

    i'm new to c#

    the following is my code:
    *************** *************** ************
    HttpWebRequest myRequest = (HttpWebRequest )WebRequest.Cre ate("http://www.google.com" );

    HttpWebResponse myResponse = (HttpWebRespons e)myRequest.Get Response();
    myResponse.Clos e();

    myRequest = (HttpWebRequest )WebRequest.Cre ate("http://www.mns.com");
    myResponse = (HttpWebRespons e)myRequest.Get Response();
    myResponse.Clos e();
    *************** *************** *************
    It works for the first site. i can read the contents of the myRequest object. But i get an error when i try to get the response of the second site.

    so how do i get a request from 2 sites? (i'm planning to check for more)
Working...