• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Delphi7安装ICS,与简单使用

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

官网 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;

 运行程序下载


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
matlab作图导出为PDF去除留白插入latex发布时间:2022-07-18
下一篇:
Matlab 霍夫变换 ( Hough Transform) 直线检测发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap