在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
下载 OverbyteIcsV816 完成后解压到E:\Delphi7\OverbyteIcsV816\
5、E:\Delphi7\OverbyteIcsV816\Packages\OverbyteIcsD7Design.dpk可视化组件 就安装完成了! uses OverbyteIcsHttpProt; uses OverbyteIcsHttpProt; i:Integer; var HttpClient:THttpCli; DataLen: Int64; var StartTime: Longword; Duration: integer; begin i:=1; HttpClient := THttpCli.Create(nil); HttpClient.NoCache := True; StartTime := GetTickCount; while i<1100 do begin // aURL:= 'http://chengyu.t086.com/cy0/'+inttostr(i)+'.html'; aURL:='http://chengyu.t086.com/cy0/'+inttostr(i)+'.html'; HttpClient.URL := aURL; HttpClient.RcvdStream := TMemoryStream.Create; try HttpClient.Get; DataLen := HttpClient.RcvdStream.Size; SetLength(aHtml, DataLen); HttpClient.RcvdStream.Position := 0; HttpClient.RcvdStream.Read(PChar(aHtml)^, DataLen); ParserHtmlSaveToSQlite(aHtml); Memo1.Lines.Add(aURL); Button1.Caption:=IntToStr(i); HttpClient.RcvdStream.Free; HttpClient.RcvdStream := nil; i:=i+1; except HttpClient.RcvdStream.Free; HttpClient.RcvdStream := nil; i:=i+1; end; end; Duration := GetTickCount - StartTime; Label1.Caption := IntToStr(Duration div 1000) + ' 秒'; HttpClient.Free; end;
uses OverbyteIcsHttpProt;
//读取网页上的多张图片,并保存在 程序文件夹内 procedure TForm1.Button1Click(Sender: TObject); var aURL,aHtml:string; i:Integer; var HttpClient: THttpCli; DataLen: Int64; var StartTime: Longword; Duration: integer; begin i:=1; HttpClient := THttpCli.Create(nil); HttpClient.NoCache := True; StartTime := GetTickCount; while i<59 do begin aURL:='http://img1.mm131.com/pic/2408/'+inttostr(i)+'.jpg'; HttpClient.URL := aURL; // HttpClient.RcvdStream := TMemoryStream.Create; HttpClient.RcvdStream := TFileStream.Create(inttostr(i)+'.jpg', fmCreate); try HttpClient.Get; Memo1.Lines.Add(aURL); Button1.Caption:=IntToStr(i); HttpClient.RcvdStream.Free; HttpClient.RcvdStream := nil; i:=i+1; except HttpClient.RcvdStream.Free; HttpClient.RcvdStream := nil; i:=i+1; end; end; Duration := GetTickCount - StartTime; Label1.Caption := IntToStr(Duration div 1000) + ' 秒'; HttpClient.Free; end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论