![Старый](images/statusicon/post_old.gif)
31.03.2014, 20:52
|
Прохожий
|
|
Регистрация: 31.03.2014
Сообщения: 1
Версия Delphi: Delphi 7
Репутация: 10
|
|
Авто-регистрация barbars.ru. Нужна помощь
[spoiler]
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, XPMan;
type
TForm1 = class(TForm)
XPManifest1: TXPManifest;
IdHTTP1: TIdHTTP;
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
ComboBox1: TComboBox;
Label3: TLabel;
ComboBox2: TComboBox;
Label4: TLabel;
ComboBox3: TComboBox;
Edit2: TEdit;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var s,s2,sex,side,pass,typ:string;
var data,data2:TStringList;
begin
sex:=ComboBox1.Text;
side:=ComboBox2.Text;
typ:=ComboBox3.Text;
pass:=Edit2.Text;
if sex='мужской' then begin sex:='m' end
else begin sex:='f' end;
if side='юг' then begin side:='1' end
else begin side:='2' end;
if typ='воин' then begin typ:='1' end
else typ:='2';
data:=TStringList.Create;
data2:=TStringList.Create;
data2.Add('password='+pass);
data2.Add('password2='+pass);
s:=IdHTTP1.Get('http://barbars.ru/registration/wicket:interface/:6:registrationForm::IFormSubmitListener::');
data.Add('login='+Edit1.Text);
data.Add('sex='+sex);
data.Add('side='+side);
data.Add('typ='+typ);
IdHTTP1.Post('http://barbars.ru/registration/wicket:interface/:6:registrationForm::IFormSubmitListener::',data);
s2:=IdHTTP1.Get('http://barbars.ru/user/protection/0/1/wicket:interface/:15:passwordForm::IFormSubmitListener::');
IdHTTP1.Post('http://barbars.ru/user/protection/0/1/wicket:interface/:15:passwordForm::IFormSubmitListener::',data2);
ShowMessage('Кажется всё вышло....');
end;
end.
Ну вот не регает ![Злость](images/smilies/mad.gif) Первый раз пишу про пост гет запросы и не знаю как проверить что не правильно. Помогите!
P.S. после того как отправил первые данные (логин,клас,пол[data]) перекидует на другую страничку и просит создать пароль -[data2]
Последний раз редактировалось KotTeam, 31.03.2014 в 21:00.
|