【bcb 6.0】http相关的控件

 

TIdHTTP

头文件包含:

#include <IdHTTP.hpp>
#include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp>
#include <IdHTTPServer.hpp>
#include <IdTCPServer.hpp>

库加载:

把C:\Program Files (x86)\Borland\CBuilder6\Lib\Release\indy.lib添加到项目里

例子

 

TIdHTTP *IdHttp=NULL;
  try
  {
  TIdHTTP *IdHttp = new TIdHTTP(this);        //´´½¨Ò»¸öTidHTTP¶ÔÏó
  TStringStream *stream_Website = new TStringStream("");    //´´½¨WebsiteÁ÷¶ÔÏó
  AnsiString string_Pagedata = "";    //Ò³ÃæData
  IdHttp->Get("www.baidu.com",stream_Website);    //»ñÈ¡Ò³Ãæ
  string_Pagedata = stream_Website->DataString;    //´ÓÁ÷Öб£´æÒ³ÃæÊý¾Ýµ½Ò»¸öString¶ÔÏóÖÐ
  delete stream_Website;    //ÊÍ·Å×ÊÔ´
  delete IdHttp;    //ÊÍ·Å×ÊÔ´
  }
  catch(Exception &e)
  {
        ShowMessage("error: "+e.Message);
    if(IdHttp!=NULL)
            delete IdHttp;
  }

 

TCppWebBrowser

 

 

如果在Internet后面没有CppWebBrowser控件,则需要手动添加到环境中:

 

Component-->Install Packages-->安装到新组件包-->找到$(BCB)/bin/bcbie60.bpl添加进来(如果连这个文件也找不到,可能是你的BCB安装不太完整)-->如果列表中存在这一项,请选中对面的对钩,这样就OK了
 
例子
 
 
 if (CppWebBrowser1->Busy)
        CppWebBrowser1->Stop();
  int len = cxHyperLinkEdit1->Text.WideCharBufSize();
  wchar_t *buf=new wchar_t[len+1];
  CppWebBrowser1->Navigate(cxHyperLinkEdit1->Text.WideChar(buf,len));
  delete[] buf;

 

 

 

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值