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

DelphiPost登陆Delphi盒子论坛源码

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

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Buttons, Vcl.OleCtrls, SHDocVw,
  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
  Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    SpeedButton1: TSpeedButton;
    IdHTTP1: TIdHTTP;
    Memo1: TMemo;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SpeedButton1Click(Sender: TObject);
Var
  cCon:TSTringList;
  cSTR,cText:TStringStream;
  i:Integer;
  TempHTTP:TIDHTTP;
begin
 IdHTTP1:=TIDHTTP.Create(nil);
 TempHTTP:=TIDHTTP.Create(nil);
 cCon:=TStringList.Create;
 IDHTTP1.HandleRedirects:=True;
 TempHTTP.HandleRedirects:=True;
 cText:=TStringStream.Create;
 IDHTTP1.Request.Accept:='image/gif, image/jpeg, image/pjpeg, image/pjpeg,application/x-shockwave-flash, application/vnd.ms-excel, ';
 IDHTTP1.Request.Accept:=IDHTTP1.Request.Accept+'application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*';
 IDHTTP1.Request.Referer:='http://bbs.2ccc.com/default.asp';
 IDHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)';
 IDHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
 IDHTTP1.Request.AcceptEncoding:='gzip, deflate';
 IDHTTP1.Request.Host:='bbs.2ccc.com';
 IDHTTP1.Request.CacheControl := 'no-cache';
 idhttp1.Request.Connection := 'Keep-Alive';
 cCon.Add('membername='+Trim(Edit1.Text));
 cCon.Add('memberpass='+Trim(Edit2.Text));
 cCon.Add('act=1');
 IDHTTP1.Post('http://bbs.2ccc.com/login.asp',cCon,cText);
// Edit3.Text:=IDHTTP1.Response.RawHeaders.Text;
 for i := 0 to IDHTTP1.CookieManager.CookieCollection.Count-1 do
    Edit3.Text:=Edit3.Text+IDHTTP1.CookieManager.CookieCollection.Cookies[i].Value;
 //IDHTTP1.GET('http://bbs.2ccc.com/',cText);
 TempHTTP.Get('http://bbs.2ccc.com/',cText);
 Memo1.Text:=cText.DataString;
 cText.Free;
end;

end.

 


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
delphi.位操作发布时间:2022-07-18
下一篇:
delphi表格数据导出到excel发布时间: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