Searching for values in a string and getting a picture
I am making this program using Borland C++ Builder 4 (yes old i know but cant afford to get the newer version) anyway what my program does is send a post data to a webpage. It then retrieves the post date and stores the whole code of the webpage to the variable 'htmlcode'
now part of the html has this code
<INPUT TYPE=HIDDEN NAME=cdate VALUE="6400">
what I want to do is get the value of 6400 (it changes all the time)
I have tried the string operation which on the helpfile said should be
variablename.find();
but .find does not seem to work (I already add #include <string.h>)
Can anyone enlighten me on how to isolate '6400' so I can store it in another variable?
Also the page I get after I send the post data contains a picture, I havent seem to find a way to get this picture since it is a .cgi file and If I load it using the HTML1 module i get a cgi error (since it needs the post data) I have no Idea how to get this file atm.
My code as it stands right now is
{
AnsiString postdata;
AnsiString htmlcode;
postdata = "checkcode=" + txtCheckcode->Text +
"&imagenumber=" + txtimagenumber->Text +;
NMHTTP1->TimeOut = 5000;
NMHTTP1->InputFileMode = false;
NMHTTP1->OutputFileMode = false;
NMHTTP1->ReportLevel = Status_Basic;
if (CheckBox1->Checked)
{
NMHTTP1->Proxy = cmbProxy->Text;
NMHTTP1->ProxyPort = StrToInt(cmbProxyport->Text);
}
NMHTTP1->HeaderInfo->Referer = "http://localhost/imagegallery.htm";
NMHTTP1->Post("http://localhost/getdata.cgi", postdata);
memDisp->Text = NMHTTP1->Body;
memDisp->Text = htmlcode;
}