![]() |
|
|
Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
|||
|
|||
![]() Пытаюсь через потоки и listview авторизироваться на нескольких сайтах. Код вызова потока использую такой
Код:
var Form2: TForm2; ind:integer=-1; Pay: array [1..2000] of ***;//создание потока http_1: array [1..2000] of TIdHTTP; IdCookieManager1_Pay: array [1..2000] of TIdCookieManager; procedure TForm1.Button2Click(Sender: TObject); var w:integer; i:integer; s:integer; URL_Pay :string; Login :string; Pass :string; begin for i:=0 to Form1.Listview1.Items.count-1 do begin URL_Pay := 'http://' + Form1.Listview1.Items[i].SubItems[0]; Login := Form1.Listview1.Items[i].SubItems[1]; Pass := Form1.Listview1.Items[i].SubItems[2]; begin ind:=-1; for w:=1 to Form1.Listview1.Items.count do begin Pay[w]:=***.Create(True); Pay[w].Resume; end; end; end; end; Код:
function getnumber:integer; begin if ind<>form1.Listview1.items.Count then inc(ind); result:=ind; end; procedure ***.Execute; var cw : integer; st:TStringStream; s:TStringStream; inf:TStringList; begin IdCookieManager1_Pay:= TIdCookieManager.Create(nil); HTTP_1 := TIdHTTP.Create(nil); cw:=getnumber; idHTTP_1.HandleRedirects := true;//возможность перенаправления idHTTP_1.AllowCookies:=true;//разрешаем куки s:=TStringStream.Create; st:=TStringStream.Create; inf:=tstringlist.create; while cw<form1.Listview1.items.Count do begin /// begin /// end else inf.Add('username=' +Login); inf.Add('password=' + Pass); idHTTP_1.Post('http://' + URL_Pay +'login.php',inf,s); inf.Free; end; в файле IdStackBSDBase.pas, подскажиет в чём ошибка? Последний раз редактировалось bulldog, 09.11.2010 в 19:07. |
#2
|
|||
|
|||
![]() Блин народ ну помогите выводится табличка с названием Debugger Exception Notification и в ней написано Project ***.exe raised exception class EIdSocketError with message 'Socket Error # 11001 Host not found.'. А как быть ума не приложу
|
#3
|
||||
|
||||
![]() На всех сайтах?
|
#4
|
||||
|
||||
![]() Код:
IdCookieManager1_Pay:= TIdCookieManager.Create(nil); Код:
IdCookieManager1_Pay[*]:= TIdCookieManager.Create(nil); Что пишем в ? Код:
URL_Pay |
#5
|
|||
|
|||
![]() Url_pay содержит списки сайтов
|
#6
|
||||
|
||||
![]() В чем смысл этого кода?
Код:
for i:=0 to Form1.Listview1.Items.count-1 do begin URL_Pay := 'http://' + Form1.Listview1.Items[i].SubItems[0]; Login := Form1.Listview1.Items[i].SubItems[1]; Pass := Form1.Listview1.Items[i].SubItems[2]; begin ind:=-1; for w:=1 to Form1.Listview1.Items.count do begin Pay[w]:=***.Create(True); Pay[w].Resume; end; end; end; Через снифер посмотри куда идет авторизация. |