Dateidownload mit C++
-
Ich bin noch Anfänger und habe ein kleines aber für mich sehr großes Problem.
Kann mir jemand sagen wie ich eine Datei per http oder ftp oder sonstwas lesen und oder downloaden kann oder wo ich das nachlesen könnte. Habe leider keine Vorstellung davon nach was ich suchen muss. mehr als die Grundlagen habe ich noch nicht drauf.
Danke schonmal für jede Art von Mithilfe.
-
Hi,
1. Indy (help)
2. Synapse - http://www.ararat.cz/synapse/
//HTTP - THTTPSend#include <memory> #include "HTTPSend.hpp" using namespace std; void __fastcall TForm1::Button1Click(TObject *Sender) { auto_ptr<THTTPSend>HTTPSend(new THTTPSend()); HTTPSend->HTTPMethod("GET", "http://www.mypage.com/myfile.txt"); Memo1->Lines->LoadFromStream(HTTPSend->Document); }
FTP - TFTPSend
3. URLDownloadToFile(...)
Menu->Project->Add to Project...
C:\Program Files\Borland\CBuilder[X]\Lib\Psdk\urlmon.lib#include <ComObj.hpp> #include <UrlMon.h> try { OleCheck(URLDownloadToFile(NULL, "http://www.mypage.com/myfile.txt", "C:\\Downloads\\myfile.txt", 0, NULL)); } catch(EOleSysError &e) { ShowMessage(AnsiString("Error : ") + e.Message); }
4. ShellExecute(...)
ShellExecute(Handle,"open","http://www.mypage.com/myfile.txt","","",SW_SHOWNORMAL); ShellExecute(Handle,"open","ftp://ftp.myftp.com/myfile.txt","","",SW_SHOWNORMAL);
[ Dieser Beitrag wurde am 17.03.2003 um 18:30 Uhr von Blazek Jaroslav editiert. ]