![]() |
|
تحميل الصور من موقع ما - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : مصادر دلفي مفتوحة تعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=14) +--- الموضوع : تحميل الصور من موقع ما (/showthread.php?tid=1844) |
تحميل الصور من موقع ما - paix144 - 27-03-2010 السلام عليكم أولا نستدعي المكاتبات كود : uses ShellApi,URLMonكود : function DownloadFile(SourceFile, DestFile: string): Boolean;
begin
try
Result := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;
except
Result := False;
end;
end;كود : procedure TForm1.Button1Click(Sender: TObject);
begin
if DownloadFile(edit1.Text, edit2.Text) then
begin
ShowMessage('Télécharger avec succé');
ShellExecute(Application.Handle, PChar('open'), PChar(edit2.Text),
PChar(''), nil, SW_NORMAL)
end
else
ShowMessage('Erreur de téléchargement' + Edit1.Text)
end; |