
21.04.2010, 21:14
|
|
Познающий
Регистрация: 02.12.2009
Сообщений: 37
С нами:
8653311
Репутация:
15
|
|
авторизация на дефли в принципе так может выглядеть:
Код:
var StrPage, ssylka:string;
Data:TstringList;
begin
idhttp1.HandleRedirects:=true;
StrPage:=idhttp1.Get('http://odnoklassniki.ru/');
ssylka:=Pars('<form action="',StrPage,'"');
Data:=TstringList.Create;
Data.Add('st.posted=set');
Data.Add('st.email='+Edit1.Text);
Data.Add('st.password='+Edit2.Text);
Data.Add('button_go=Войти');
StrPage:=idhttp1.Post(ssylka, Data);
if Pos('Logoff', StrPage)<>0 then
Label3.Caption:='Ага'
else Label3.Caption:='Неа';
Data.Free;
function TForm1.Pars(T_, ForS, _T: string): string;
var
a, b: integer;
begin
Result := '';
if (T_ = '') or (ForS = '') or (_T = '') then
Exit;
a := Pos(T_, ForS);
if a = 0 then
Exit
else
a := a + Length(T_);
ForS := Copy(ForS, a, Length(ForS) - a + 1);
b := Pos(_T, ForS);
if b > 0 then
Result := Copy(ForS, 1, b - 1);
end;
end;
|
|
|