 |
|
|
 |
There are currently, 4 guest(s) and 0 member(s) online.
You are an anonymous user. You can register for free by clicking here
|
|
 |
 |
Downloading all files (*.*) from within Delphi
Posted by: Gayle |
|
 |
Topic Internet & Web
You can use this code to download all files from an FTP site from within your Delphi program.
Uses WININET;
function TMyFtp.FindFiles: TStringList; var FindData: TWin32FindData; FindHandle: HInternet; Begin FindHandle := FtpFindFirstFile(FFtphandle, '*.*', FindData, 0, 0); If FindHandle = nil Then Begin Result := nil; Exit; End; FCurFiles.Clear; FCurFiles.Add(GetFindDataStr(FindData));
While InternetFindnextFile(FindHandle, @FindData) Do FCurFiles.Add(GetFindDataStr(FindData)); InternetCloseHandle(Findhandle); GetCurrentDirectory; Result := FCurFiles; End;
function GetFindDataStr(FindData: TWin32FindData): string;
//Get current files in directory
var S: string; Temp: string; Begin S := S + GetDots(75); Move(FindData.CFilename[0], S[6], StrLen(FindData.CFileName)); Temp := IntToStr(FindData.nFileSizeLow); Move(Temp[1], S[25], Length(Temp)); Result := S; End;
function TMyFtp.FindFiles: TStringList; var FindData: TWin32FindData; FindHandle: HInternet; Begin FindHandle := FtpFindFirstFile(FFtphandle, '*.pjl', FindData, 0, 0);
If FindHandle = nil then Begin Result := nil; Exit; end; FCurFiles.Clear; FCurFiles.Add(GetFindDataStr(FindData));
While InternetFindnextFile(FindHandle, @FindData) Do
FCurFiles.Add(GetFindDataStr(FindData)); InternetCloseHandle(Findhandle); GetCurrentDirectory; Result := FCurFiles;
End;
function TECU.GetFile(FTPFile, NewFile: string): Boolean;
//Download a File Through FTP
begin Result := FtpGetFile(FFTPHandle, PChar(FTPFile), PChar(NewFile), False, File_Attribute_Normal, Ftp_Transfer_Type_Binary, 0); end;
Procedure Button1.Onclick(); ar MyHandle: HINTERNET; //handle from InternetConnect Begin MyHandle := InternetOpen(`ECU', 0, nil, 0, 0); InternetConnect(MyHandle, .linksarray[0]., 0, Anonymouse, .linksarray[1]., INTERNET_SERVICE_FTP, INTERNET_CONNECT_FLAG_PASSIVE, 0 );
//Changes to a specific directory once connected TECU.ChangeDirExact('ftp://ftp.mysite.com/downloads'); FindHandle := FtpFindFirstFile(FFtphandle, '*35L.PJL', FindData, 0, 0);
// If the directory is blank, then tell me about it. Else, download all. If FindHandle = nil Then Begin Result := nil; ShowMessage('The file was not able to be downloaded. Please Re-Try'); End
Else TECU.GetFile('*.*', 'c:\*.*'); End; End;
//The call InternetConnect Uses the following function ( included with WinInet ):
{******************************************************************************* function InternetConnect( hInet: HINTERNET; // Handle from InternetOpen lpszServerName: PChar; // Server: i.e., www.borland.com nServerPort: INTERNET_PORT; // Usually 0 lpszUsername: PChar; // usually anonymous lpszPassword: PChar; // usually your email address dwService: DWORD; // FTP, HTTP, or Gopher? dwFlags: DWORD; // Usually 0 dwContext: DWORD): // User defined number for callback HINTERNET; stdcall;
*******************************************************************************}
|
 |
 |
| |
 |
|
|
 |
| Don't have an account yet? You can create one. As a registered user you have some advantages like a theme manager, comments configuration and posting comments with your name. |
|
| "Downloading all files (*.*) from within Delphi" | Login/Create an account | 4 Comments |
|
| | Comments are owned by the poster. We aren't responsible for their content. |
Re: Downloading all files (*.*) from within Delphi(Score: 0) by Anonymous on Aug 10, 2009 - 08:34 AM | | Greetings. Check our page with best informations: Small games, Miniclip games |
[ Comments not allowed for anonymous users, please register ]
Re: Downloading all files (*.*) from within Delphi(Score: 0) by Anonymous on Nov 12, 2009 - 08:47 AM | | film des dessin anim porn, tr s poilues sous les bras , vid o sex hijab, sexe tv nymphos, actrices arabe nue, sexy clips amateur gratuit, blog video zoo sex, clip zoophilie video gratuite, girls bergamo bakeca, w w w youporn at, animal sex movies, enorme bite stream, ado nue hard, webcam porno crack, porno xx fr, femmes baisant avec cheval, sex filimi izlet bedava, yasmine sex streaming, recit femme zoophile , download video porno da red tube |
[ Comments not allowed for anonymous users, please register ]
Re: Downloading all files (*.*) from within Delphi(Score: 0) by Anonymous on Nov 29, 2009 - 10:47 AM | | alg riesex, video porno gratis con cicciolina con i cavalli, www jeux de cheval com, sex donna incinta, comment fais ejaculer une famme, siti tipo redtube, galerie femmes porno, mec 50 ans viril et muscl nu en vid o, video de fille 14 16 porno, photo porno de petite filles mineur, vi ille mamie toute nue, porntube x, zoophilli, recherche femme tres gros clitoris , amandine version pornographique, video real xx porno, extraits videos gratuite de julia channel, extrait video pissing gratuit, estrait zoophilie femme et cheval, clip porno exterieur |
[ Comments not allowed for anonymous users, please register ]
Re: Downloading all files (*.*) from within Delphi(Score: 0) by Anonymous on Jan 24, 2010 - 11:30 AM | | salope en lingerie red tube, film porno femme asia torrents, photo zoophi, lupaland free, vid o gratuites vieux avec jeunes, photo ma femme nue, incest famille dvd teen, asiatic fille masturbee video, youporn poursuites, gratuit vid os vieille avec gode sans mail |
[ Comments not allowed for anonymous users, please register ]
|