bestlong 怕失憶論壇
標題:
用 URL 下載檔案
[打印本頁]
作者:
bestlong
時間:
2006-5-20 14:59
標題:
用 URL 下載檔案
在 uese 宣告 URLMon
然後加入下列函數
function DownloadFile(Source, Dest: string): Boolean;
begin
try
Result := UrlDownloadToFile(nil, PChar(source), PChar(Dest), 0, nil) = 0;
except
Result := False;
end;
end;
// Example:
procedure TForm1.Button1Click(Sender: TObject);
begin
if DownloadFile ('http://www.delphi3000.com/index.htm, 'c:\index.htm') then
ShowMessage('Download successful')
else
ShowMessage('Download unsuccessful')
end;
複製代碼
歡迎光臨 bestlong 怕失憶論壇 (http://www.bestlong.idv.tw/)
Powered by Discuz! X1.5