Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TForm1.Pars(T_, ForS, _T: string): string;
- var
- a, b: Integer;
- a, b: Integer;
- begin
- Result := '';
- Result := '';
- if (T_ = '') or (ForS = '') or (_T = '') then
- if (T_ = '') or (ForS = '') or (_T = '') then
- Exit;
- Exit;
- a := Pos(T_, ForS);
- a := Pos(T_, ForS);
- if a = 0 then
- if a = 0 then
- Exit
- Exit
- else
- else
- a := a + Length(T_);
- a := a + Length(T_);
- ForS := Copy(ForS, a, Length(ForS) - a + 1);
- ForS := Copy(ForS, a, Length(ForS) - a + 1);
- b := Pos(_T, ForS);
- b := Pos(_T, ForS);
- if b > 0 then
- if b > 0 then
- Result := Copy(ForS, 1, b - 1);
- Result := Copy(ForS, 1, b - 1);
- end;
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- Data := Tstringlist.Create;
- Data := Tstringlist.Create;
- Data.Add('data');
- Data.Add('data');
- Data.Add('login');
- Data.Add('login');
- Data.Add('_sourcePage=/WEB-INF/jsp_modern/user/register_with_car_selector_tab.jsp');
- Data.Add('_sourcePage=/WEB-INF/jsp_modern/user/register_with_car_selector_tab.jsp');
- Data.Add('ajax=False');
- Data.Add('ajax=False');
- Data.Add('userName=' + Edit3.Text);
- Data.Add('userName=' + Edit3.Text);
- Data.Add('password=' + Edit4.Text);
- Data.Add('password=' + Edit4.Text);
- IdHTTP1.Post(Edit6.Text+'/mitglieder/aktion/RegisterUser.html', Data);
- IdHTTP1.Post(Edit6.Text+'/mitglieder/aktion/RegisterUser.html', Data);
- IdHTTP1.Request.Host := Edit6.Text;
- IdHTTP1.Request.Host := Edit6.Text;
- IdHTTP1.Request.UserAgent :=
- IdHTTP1.Request.UserAgent :=
- 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10';
- 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10';
- IdHTTP1.Request.Accept := 'application/xml, text/xml, */*';
- IdHTTP1.Request.Accept := 'application/xml, text/xml, */*';
- IdHTTP1.Request.AcceptLanguage := 'en-gb,en;q=0.5';
- IdHTTP1.Request.AcceptLanguage := 'en-gb,en;q=0.5';
- IdHTTP1.Request.AcceptEncoding := 'gzip,deflate';
- IdHTTP1.Request.AcceptEncoding := 'gzip,deflate';
- IdHTTP1.Request.AcceptCharset := 'ISO-8859-1,utf-8;q=0.7,*;q=0.7';
- IdHTTP1.Request.AcceptCharset := 'ISO-8859-1,utf-8;q=0.7,*;q=0.7';
- IdHTTP1.Request.Connection := 'keep-alive';
- IdHTTP1.Request.Connection := 'keep-alive';
- IdHTTP1.Request.ContentType :=
- IdHTTP1.Request.ContentType :=
- 'application/x-www-form-urlencoded; charset=UTF-8';
- 'application/x-www-form-urlencoded; charset=UTF-8';
- IdHTTP1.Request.Referer := Edit6.Text;
- IdHTTP1.Request.Referer := Edit6.Text;
- IdHTTP1.Request.Pragma := 'no-cache';
- IdHTTP1.Request.Pragma := 'no-cache';
- IdHTTP1.Request.CacheControl := 'no-cache';
- IdHTTP1.Request.CacheControl := 'no-cache';
- try
- try
- Request := IdHTTP1.Post(Edit6.Text, Data);
- Request := IdHTTP1.Post(Edit6.Text, Data);
- s:=IdHTTP1.Post(Edit6.Text+'/mitglieder/aktion/RegisterUser.html', Data);
- s:=IdHTTP1.Post(Edit6.Text+'/mitglieder/aktion/RegisterUser.html', Data);
- if Pos(Edit3.Text,s)<> 0 then
- if Pos(Edit3.Text,s)<> 0 then
- begin
- begin
- Offline.Font.Color := cLlime;
- Offline.Font.Color := cLlime;
- Offline.Caption := 'Online';
- Offline.Caption := 'Online';
- end;
- end;
- p:=IdHTTP1.Get('http://www.motor-talk.de/mitglieder/aktion/LoginUser.html?userName='+Edit3.Text+'&login&password='+edit4.Text);
- p:=IdHTTP1.Get('http://www.motor-talk.de/mitglieder/aktion/LoginUser.html?userName='+Edit3.Text+'&login&password='+edit4.Text);
- if Pos(Edit3.Text,p)<> 0 then
- if Pos(Edit3.Text,p)<> 0 then
- begin
- begin
- Offline.Font.Color := cLlime;
- Offline.Font.Color := cLlime;
- Offline.Caption := 'Online';
- Offline.Caption := 'Online';
- end;
- end;
- g := Pars('alt="', Edit3.Text, '" src="http://avatars.motor-talk.de/data/avatars/20/2058431.gif"/>');
- g := Pars('alt="', Edit3.Text, '" src="http://avatars.motor-talk.de/data/avatars/20/2058431.gif"/>');
- Memo2.Clear;
- Memo2.Clear;
- Memo2.Lines.Add(s);
- Memo2.Lines.Add(s);
- Memo2.Lines.Add('----------------------------------------------------');
- Memo2.Lines.Add('----------------------------------------------------');
- Memo2.Lines.Add(p+'=Результат.');
- Memo2.Lines.Add(p+'=Результат.');
- Memo2.Lines.Add('----------------------------------------------------');
- Memo2.Lines.Add('----------------------------------------------------');
- Memo2.Lines.Add(g+'=Результат.');
- Memo2.Lines.Add(g+'=Результат.');
- finally
- finally
- Data.Clear;
- Data.Clear;
- Request := '';
- Request := '';
- s := '';
- s := '';
- g := '';
- g := '';
- p := '';
- p := '';
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement