470,870 Members | 1,546 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

reading an internet page


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:

Expand|Select|Wrap|Line Numbers
  1. AnsiString link;
  2. link = "http://www.cnn.com";
  3. NMHTTP1->Get(link);
  4. MyList = new TStringList;
  5. MyList->Add(NMHTTP1->Body);
  6. MyList -> SaveToFile("test.txt");
  7. 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...?

Apr 8 '08 #1
0 889

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Eddie | last post: by
1 post views Thread by Jonathan | last post: by
2 posts views Thread by kinh | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.