uses <br> UrlMon<br>function DownloadFile(Source, Dest: string): Boolean; <br>begin <br> try<br> Result := UrlDownloadToFile(nil, PChar(source), PChar(Dest), 0, nil) = 0;<br> except<br> Result := False;<br> end;<br>end;<br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> if DownloadFile(edit1.Text, edit2.Text) then<br> ShowMessage('下载成功')<br> else ShowMessage('下载失败');<br>end;<br><br>其中:<br><br>edit1.Text为连接地址(如:http://community.csdn.net/Expert/TopicView3.asp?id=3482237)<br><br>edit2.Text为保存文件的路径及文件名(如:e:/123.htm)