reading an internet page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bropolwig
    New Member
    • Apr 2008
    • 1

    #1

    reading an internet page

    Hi,

    I'm fairly new at programming, so bear with me ;-) I use borland c++ builder to do some programming. I sometimes have a problem reading an internet page using the NMHTTP component. I use the following code fragment to read a page and output it to a text file:

    Code:
    AnsiString link;
    link = "http://www.cnn.com";
    NMHTTP1->Get(link);
    MyList = new TStringList;
    MyList->Add(NMHTTP1->Body);
    MyList -> SaveToFile("test.txt");
    delete MyList;
    This works most of the times. However, sometimes the program kind of "hangs". The cpu uses 100% but the page is not loaded. The page is accessible though when I use a normal web browser. So my question is if there is a way to check that the nmhttp component succesfully connects and loads the page or else have it retry the connection or...?

    Thanks!
Working...