乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Delphi UrlDownloadToFile 實(shí)現(xiàn)文件下載

       遠(yuǎn)在南非 2010-08-18
      Delphi實(shí)現(xiàn)文件下載UrlDownloadToFile
      UrlDownloadToFile是一個(gè)非常不錯(cuò)的函數(shù),我們可以用它來(lái)下載各種格式的圖片、音樂(lè)、文件等等。
      Uses URLMon, ShellApi;

      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);
      const
      // URL Location
      SourceFile:='http://www.0523www.como/images/logo.gif';
      // Where to save the file
      DestFile := 'c:\3k2.gif';
      begin
      if DownloadFile(SourceFile, DestFile) then
      begin
      ShowMessage('下載成功!');
      // Show downloaded image in your browser
      ShellExecute(Application.Handle,PChar('open'),PChar(DestFile),PChar(''),nil,SW_NORMAL)
      end
      else
      ShowMessage(SourceFile+'下載出錯(cuò)!')
      end;

      如果涉及批量下載,那么在上例中Button1Click我們可以這樣寫(xiě):
      procedure TForm1.Button1Click(Sender: TObject);
      //---自己定義一個(gè)URL List和文件命名的List---//
      begin
      if DownloadFile(URLList, FileName) then
      begin
      ShowMessage('下載成功!');
      ShellExecute(Application.Handle,PChar('open'),PChar('路徑'+FileName+'.exe'),PChar(''),nil,SW_NORMAL) //這句用不上,就閃掉,只做下載測(cè)試用。
      end
      else
      ShowMessage(URLList+'下載出錯(cuò)!')
      end;

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶(hù) 評(píng)論公約

        類(lèi)似文章 更多