Article View: borland.public.cppbuilder.internet.socket
Article #419Re: What Indy10 C++ ide objects does one use to download a file
From: Remy Lebeau (TeamB)
Date: Fri, 01 Feb 2008 18:42
Date: Fri, 01 Feb 2008 18:42
28 lines
1789 bytes
1789 bytes
"401kPensionGuru" <charlesleggette@earthlink.net> wrote in message
news:47a272c5@newsgroups.borland.com...
> 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("http://ichart.finance.yahoo.com/table.csv?s=%s&d=%i&e=%i&f=%i&g=d&a=%i&b=%i&c=%i&ignore=.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
Technical Details
Message-ID:
<47a367ef@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47a272c5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,10fb6e668abaf1bd X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <47a272c5@newsgroups.borland.com> Subject: Re: What Indy10 C++ ide objects does one use to download a file Date: Fri, 1 Feb 2008 10:42:36 -0800 Lines: 30 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <47a367ef@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1201891311 207.178.157.90 (1 Feb 2008 10:41:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail