Internet Algorithm

This algorithm may be needed in programs loaders, whose task is to download files from the Internet, such as software download master, or application for that process web pages. The latter Related different kinds of parsers that process and downloaders from the pages of the chosen site opredelonogo opredennomu pattern information, or similar software is the task of downloading the full site given argument. Implement this task can be in three different ways. First, using the standard components of Delphi IDE for working with the network about this method can be found in the book Foundations of Delphi. Professional approach. Second, with help functions Win32 – it is the most difficult option, but the code get the most 'fast', use it if you want to achieve the fastest possible execution and most optimal and easy option with help Delphi library functions, they are based on the Win32 API. uses URLMon; … function DLFile (Source, File: string): boolean; begin try Result: = UrlDownloadToFile (nil, PChar (Source), PChar (File), 0, nil) = 0; / / Source – a source from which the file is downloaded, or the page / / File – the path on your computer to save the downloaded file or page funnaly Result: = false; / / in case error function is not nothing sledaet and the program will exit with a message about a critical error, just nothing happens end; end; Example: procedure TForm1.Button1Click (Sender: TObject); begin DownloadFile ('', 'c: working stolsite. com.txt '); end; This alternative solution is the best if you have to use operating system functions that would have to write a lot of extra code to check peredavaymyh parameters, checking the value returned by the functions and etc. In the case of components subject to the mandatory use of forms that do not always really need and create them just because you do not know how realzovat a particular algorithm is Group.