🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
2 messages
2 total messages Started by 401kPensionGuru Fri, 01 Feb 2008 01:15
What Indy10 C++ ide objects does one use to download a file
#416
Author: 401kPensionGuru
Date: Fri, 01 Feb 2008 01:15
16 lines
1744 bytes
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("http://ichart.finance.yahoo.com/table.csv?s=%s&d=%i&e=%i&f=%amp;g=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
#419
Author: Remy Lebeau (TeamB)
Date: Fri, 01 Feb 2008 18:42
28 lines
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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads