使用Indy9 或ICS6 访问HttpS网站的代码示例(100)

  • 主题发起人 主题发起人 夜鹰
  • 开始时间 开始时间

夜鹰

Unregistered / Unconfirmed
GUEST, unregistred user!
可以随便指定一Https网站,通过程序使用用户名、密码登录,并进行数据交互
 
还真写过 等等我给你找找啊!
 
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdTCPConnection, IdTCPClient, IdHTTP, IdBaseComponent, IdComponent, IdIOHandler, IdIOHandlerSocket, IdSSLOpenSSL, ExtCtrls;type TForm1 = class(TForm) IdSSLIOHandlerSocket1: TIdSSLIOHandlerSocket; IdHTTP1: TIdHTTP; Panel1: TPanel; Number: TMemo; Panel2: TPanel; Splitter1: TSplitter; Panel3: TPanel; Button2: TButton; Button3: TButton; Label1: TLabel; Edit1: TEdit; Label2: TLabel; Edit2: TEdit; Button4: TButton; Memo1: TMemo; Splitter2: TSplitter; Memo2: TMemo; Button1: TButton; Button5: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1; ExitScan : boolean = false;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var List : TStringList; Key, CNum : String;begin Key := Trim(Edit1.Text); CNum := '13359797183'; List := TStringList.Create; List.Clear;{ List.Add('AgentType=""'); List.Add('AgentNo=""'); List.Add('dse_sessionId="'+Key+'"'); List.Add('dse_applicationId="-1"'); List.Add('dse_operationName="PaymentCPOOp"'); List.Add('dse_pageId="10"'); List.Add('TranTag="0"'); List.Add('recordTag="0"'); List.Add('ProxyReqTitle="custcode"'); List.Add('ProxyReqData="'+CNum+'"'); List.Add('Sort="2"'); List.Add('ChildSort="查缴联通手机费"'); List.Add('head_top_num="2"'); List.Add('randomId="'+Key+'"'); } List.Add('AgentType='); List.Add('AgentNo='); List.Add('dse_sessionId='+Key+''); List.Add('dse_applicationId=-1'); List.Add('dse_operationName=PaymentCPOOp'); List.Add('dse_pageId=10'); List.Add('TranTag=0'); List.Add('recordTag=0'); List.Add('ProxyReqTitle=custcode'); List.Add('ProxyReqData='+CNum+''); List.Add('Sort=2'); List.Add('ChildSort=查缴联通手机费'); List.Add('head_top_num=2'); List.Add('randomId='+Key+''); memo1.Lines.Text := IdHTTP1.Post('https://mybank.icbc.com.cn/servlet/com.ibm.dse.cs.servlet.CSReqServlet',List); List.Free;end;procedure TForm1.Button2Click(Sender: TObject); procedure ADDNumber(AStr:String); var x, y : integer; begin for x := 0 to 9 do begin for y := 0 to 9 do begin Number.Lines.Add(Format('%s%d%d%d%d',[AStr,x,x,x,y])); end; end; end;begin ADDNumber('1330467'); ADDNumber('1331464'); ADDNumber('1333932'); ADDNumber('1332932'); ADDNumber('1335979'); ADDNumber('1335114'); ADDNumber('1335124'); ADDNumber('1335126'); ADDNumber('1338464'); ADDNumber('1532651'); ADDNumber('1530467'); Number.Lines.SaveToFile('c:/Number.txt');end;procedure GET(Str:String; Var xm:String; Var hh:String);var I,Len:integer; s : String;begin if pos('<td height="50%" valign="middle" align="left" width="60%">系统错误</td>',Str) <> 0 then begin xm := '空号'; hh := '0.00'; end else begin S := '用户姓名:</td>'; I := Pos(S, Str); Len := length(S); delete(Str,1, i + len -1); S := '<td height="26" valign="middle" align="left" width="60%">'; I := Pos(S, Str); Len := length(S); delete(Str,1, i + len -1); S := '</td>'; I := Pos(S, Str); xm := Copy(Str,1,i-1); S := '<td height="26" valign="middle" align="left" width="60%">'; I := Pos(S, Str); Len := length(S); delete(Str,1, i + len -1); S := '</td>'; I := Pos(S, Str); hh := Copy(Str,1,i-1); xm := Copy(XM,1,20); HH := COPY(HH,1,10); end;end;procedure TForm1.Button3Click(Sender: TObject);var List : TStringList; Key, CNum, Temp, _xm, _hh : String;begin ExitScan := False; while (Number.Lines.Count <> 0) and (Not ExitScan) do begin Edit2.Text := Number.Lines[0]; Number.Lines.Delete(0); Key := Trim(Edit1.Text); CNum := Trim(Edit2.Text); List := TStringList.Create; List.Clear; List.Add('AgentType='); List.Add('AgentNo='); List.Add('dse_sessionId='+Key+''); List.Add('dse_applicationId=-1'); List.Add('dse_operationName=PaymentCPOOp'); List.Add('dse_pageId=10'); List.Add('TranTag=0'); List.Add('recordTag=0'); List.Add('ProxyReqTitle=custcode'); List.Add('ProxyReqData='+CNum+''); List.Add('Sort=2'); List.Add('ChildSort=查缴联通手机费'); List.Add('head_top_num=2'); List.Add('randomId='+Key+''); Try Temp := IdHTTP1.Post('https://mybank.icbc.com.cn/servlet/com.ibm.dse.cs.servlet.CSReqServlet',List); Except on e:exception do begin Memo1.Lines.Add(E.Message); end; End; List.Free; Memo2.Lines.Text := Temp; Memo2.Lines.SaveToFile('C:/Temp/'+CNum+'.txt'); GET(Temp, _xm, _hh); Memo1.Lines.Add(Format('%s, %s, %s',[CNum, _xm, _hh])); Memo1.Lines.SaveToFile('c:/jj.txt'); Application.ProcessMessages; end;end;procedure TForm1.Button4Click(Sender: TObject);var _hh,_xm:string;begin GET(Memo1.Lines.Text, _xm, _hh); ShowMessage(_xm + #13 + _hh);end;procedure TForm1.Button5Click(Sender: TObject);begin ExitScan := True;end;end.以前写的通过工行网上银行查找AAAB结尾的空手机号的软件!第一天好使 第二天我机器好像被封了 再也上不了网上银行了!但是同一内网其他机器用我账号依然好使!可能是限制我机器了 呵呵!写的过于简陋
 
后退
顶部