Привет всем,у меня такая проблема.Пытаюсь авторизоваться на форуме но при нажатие Button у меня вылетает ошибка Access violation...
вот код
Код:
var
Form1: TForm1;
data:TStringList;
a1:TStringStream;
idh1:tidhttp;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
idh1.Request.Referer:='http://сайт/index.php?act=Login&CODE=00';
idh1.Request.Accept:='text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
idh1.Post('http://сайт/index.php?act=Login&CODE=01', data, a1);
idh1.Request.Referer:='http://сайт/index.php?act=Login&CODE=01';
memo1.Text:=idh1.Get('http://сайт/index.php?act=idx');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
data:=TStringList.Create;
a1:=TStringStream.Create('');
data.Add('referer=http%3A%2F%2Fсайт%2Fforum%2Findex.php%3F');
data.Add('UserName=логин');
data.Add('PassWord=пароль');
end;
end.
Где здесь собака зарыта?