Board index » cppbuilder » What Indy10 C++ ide objects does one use to download a file

What Indy10 C++ ide objects does one use to download a file


2008-02-01 09:15:49 AM
cppbuilder32
I'm in need of yahoo .csv file that has historic prices of stocks....I'm
bewildered by the array of Indy Objects and their parts....
can anyone get me started...I know how to use indy to send/receive mail
...but this seems far removed from that issue...
Thanks in advance...here is some \nSoftware code I've been using...but I
need to do this in Indy...
HTTPS1->LocalFile = file2Write;
//tDiskfile->Text;
urlAddress.sprintf("ichart.finance.yahoo.com/table.csv=d&a=%i&b=%i&c=%i&ignore=.csv
",
m_ticker->Text,
end.MM(), end.DD(), end.YYYY(),
start.MM(), start.DD(),start.YYYY()); //tURL->Text);
SetCursorWait();
HTTPS1->Get(urlAddress); //this downloads the file
 
 

Re:What Indy10 C++ ide objects does one use to download a file

"401kPensionGuru" < XXXX@XXXXX.COM >wrote in message
Quote
I'm in need of yahoo .csv file that has historic prices of stocks....
I'm bewildered by the array of Indy Objects and their parts....
can anyone get me started...
Since you are trying to download a file from an HTTP server, you need to use
the TIdHTTP component, ie:\
urlAddress.sprintf("ichart.finance.yahoo.com/table.csv
m_ticker->Text.c_str(), end.MM(), end.DD(), end.YYYY(), start.MM(),
start.DD(), start.YYYY());
TFileStream *strm = new TFileStream(file2Write, fmCreate);
try
{
SetCursorWait();
IdHTTP1->Get(urlAddress, strm); //this downloads the file
}
__finally
{
delete strm;
}
Gambit