Delphi7 安装ICS,与简单使用
2018-06-17 18:57:27来源:未知 阅读 ()
官网 http://www.overbyte.be/
下载 OverbyteIcsV816 完成后解压到E:\Delphi7\OverbyteIcsV816\
1、在library里加入E:\Delphi7\OverbyteIcsV816\Source目录。
2、从File->Open中打开E:\Delphi7\OverbyteIcsV816\Install\D7Install.bpg文件。(文件名在其它Delphi版本略有不同)
3、在项目管理器中,右键OverbyteIcsD7Design.bpl选择Build和Install---要把BPL输出目录也加入 1、在library里
64位系统
4、将D:\软件\Delphi777777\bpl\OverbyteIcsD7Design.bpl
D:\软件\Delphi777777\bpl\OverbyteIcsD7Run.bpl
拷贝到 C:\Windows\SysWOW64下
5、E:\Delphi7\OverbyteIcsV816\Packages\OverbyteIcsD7Design.dpk可视化组件
就安装完成了!
uses OverbyteIcsHttpProt;
//单个网址,返回网页源代码
function HttpGet(const Url: string; var Html: string): Boolean; var HttpClient: THttpCli; DataLen: Int64; FailMsg: string; begin Result := False; HttpClient := THttpCli.Create(nil); HttpClient.URL := Url; HttpClient.NoCache := True; HttpClient.RcvdStream := TMemoryStream.Create; try try HttpClient.Get; DataLen := HttpClient.RcvdStream.Size; SetLength(Html, DataLen); HttpClient.RcvdStream.Position := 0; HttpClient.RcvdStream.Read(PChar(Html)^, DataLen); Result := True; except on E: EHttpException do begin FailMsg := Format('Failed : %d %s', [HttpClient.StatusCode, HttpClient.ReasonPhrase]); end else raise; end; finally HttpClient.RcvdStream.Free; HttpClient.RcvdStream := nil; HttpClient.Free; end; end;
uses OverbyteIcsHttpProt;
//用一个THttpCli访问多个网址,以节省资源,返回网页源代码
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<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;
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- delphi10.3安装使用mySQL 2020-05-31
- UniGui安装(01) 2020-01-31
- DELPHI网页开发神器UNIGUI的安装与演示 2019-08-16
- Delphi 7~XE系列升级安装Indy10.6 2018-12-13
- VS2012完全卸载与VS2013安装 2018-06-17
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash