![]() |
|
|
#1 (permalink) |
|
*BUNALIMLARIN ADMİNİ*
![]() |
Download Programı Yapmak
procedure gy_DownloadFile_to_file(const Url: string;File1 File2: String; Obj:TObject);var NetHandle: HINTERNET; UrlHandle: HINTERNET; Buffer: array[0..1024] of Char; Toplam BytesRead NumWritten: dWord;ToF: file; begin Toplam:=0; NetHandle := InternetOpen('Delphi 5.x' INTERNET_OPEN_TYPE_PRECONFIG nil nil 0);if Assigned(NetHandle) then begin UrlHandle := InternetOpenUrl(NetHandle PChar(Url) nil 0 INTERNET_FLAG_RELOAD 0);if Assigned(UrlHandle) then { UrlHandle valid? Proceed with download } begin FillChar(Buffer SizeOf(Buffer) 0);AssignFile(ToF file1);Rewrite(ToF 1); { Record size = 1 }repeat FillChar(Buffer SizeOf(Buffer) 0);InternetReadFile(UrlHandle @Buffer SizeOf(Buffer) BytesRead);Toplam := Toplam + BytesRead; if assigned(Obj) and ( Obj is TLabel) then TLabel(obj).caption := File2+' '+ FloatToStr(Toplam)+' Byte indi ' ;BlockWrite(ToF Buffer BytesRead NumWritten);Application.ProcessMessages; until BytesRead = 0; InternetCloseHandle(UrlHandle); CloseFile(ToF); end else { UrlHandle is not valid. Raise an exception. } raise Exception.CreateFmt('Cannot open URL %s' [url]);InternetCloseHandle(NetHandle); end else { NetHandle is not valid. Raise an exception } raise Exception.Create('Unable to initialize Wininet'); end; |
|
|
|
![]() |
| Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| Seçenekler | |
| Stil | |
|
|
Benzer Konular
|
||||
| Konu | Konuyu Başlatan | UslanmaM | Cevaplar | Son Mesaj |
| yapmak isteyipde yapamadıklarınız (acaba kim ne yapmak istiyo görelim) | FeArLeSs | UslanmaM Oyunları | 48 | 06-02-2008 08:48 PM |
| Resimli/Setup Programı Yapmak | CENGiZ1 | Resimli Program Açıklamaları | 4 | 01-30-2008 08:07 PM |
| download programı | BoDyGuArD | Orjinal Sitelerinden Programlar | 0 | 03-07-2007 08:56 AM |
