Вот писал авторегер для сайта http://icq-halyava.com/ Помогите найти ошибки!!! Code: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; function recognize(filename: string; apikey: string; is_phrase: boolean; is_regsense: boolean; is_numeric: boolean; min_len: integer; max_len: integer): string; type TForm1 = class(TForm) Button1: TButton; IdHTTP1: TIdHTTP; GroupBox1: TGroupBox; GroupBox2: TGroupBox; Edit1: TEdit; Memo1: TMemo; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function RandomPwd(PWLen: integer): string; const StrTable: string = 'ABCDEFGHIJKLMabcdefghijklm' + '0123456789' + 'NOPQRSTUVWXYZnopqrstuvwxyz'; var N, K, X, Y: integer;// проверяем максимальную длину пароля begin if (PWlen > Length(StrTable)) then K := Length(StrTable)-1 else K := PWLen; SetLength(result, K); // устанавливаем длину конечной строки Y := Length(StrTable); // Длина Таблицы для внутреннего цикла N := 0; // начальное значение цикла while N < K do begin // цикл для создания K символов X := Random(Y) + 1; // берём следующий случайный символ // проверяем присутствие этого символа в конечной строке if (pos(StrTable[X], result) = 0) then begin inc(N); // символ не найден Result[N] := StrTable[X]; // теперь его сохраняем end; end; end; function recognize(filename: string; apikey: string; is_phrase: boolean; is_regsense: boolean; is_numeric: boolean; min_len: integer; max_len: integer): string; var ftype,tmpstr,captcha_id,sql: String; i: integer; http: TIdHTTP; multi: Tidmultipartformdatastream; begin if FileExists(filename)=false then begin result:='ERROR: file not found'; exit; end; sql:='capcha.png' ftype:='image/png'; multi:=Tidmultipartformdatastream.Create; multi.AddFormField('method','post'); multi.AddFormField('key',apikey); multi.AddFile('file',sql,ftype); if is_phrase=true then multi.AddFormField('phrase','1'); if is_regsense=true then multi.AddFormField('regsense','1'); if is_numeric=true then multi.AddFormField('numeric','1'); if min_len>0 then multi.AddFormField('min_len',inttostr(min_len)); if max_len>0 then multi.AddFormField('max_len',inttostr(max_len)); http:=TIdHTTP.Create(nil); tmpstr:=http.Post('http://antigate.com/in.php',multi); http.Free; captcha_id:=''; if strpos(Pchar(tmpstr),'ERROR_')<>nil then begin result:=tmpstr; exit; end; if strpos(Pchar(tmpstr),'OK|')<>nil then captcha_id:=AnsiReplaceStr(tmpstr,'OK|',''); if captcha_id='' then result:='ERROR: bad captcha id'; for i:=0 to 20 do begin Application.ProcessMessages; sleep(5000); http:=TIdHttp.Create(nil); tmpstr:=http.Get('http://antigate.com/res.php?key='+apikey+'&action=get&id='+captcha_id); http.Free; if strpos(Pchar(tmpstr),'ERROR_')<>nil then begin result:=tmpstr; exit; end; if strpos(Pchar(tmpstr),'OK|')<>nil then begin result:=AnsiReplaceStr(tmpstr,'OK|',''); exit; end; Application.ProcessMessages; end; result:='ERROR_TIMEOUT'; end; procedure TForm1.Button1Click(Sender: TObject); var sql,capcha,login,pass,email,email2,S:string; Data:TStringList; begin sql:='captcha.png'; capcha:=recognize(sql,Edit1.Text,false,false,false,0,0); login:=RandomPwd(7); pass:=RandomPwd(6); email:=RandomPwd(7); email2:=email+'@mail.ru'; Data:=TStringList.Create; Data.Add('nik='+login); Data.Add('e_mail='+email2); Data.Add('password='+pass); Data.Add('password='+pass); Data.Add('kod='+capcha); Data.Add('rega =Зарегистрироваться'); S:=IdHTTP1.Post('http://icq-halyava.com/reg.php', Data); Memo1.Lines.Add('Login:'+login); Memo1.Lines.Add('Passworld:'+Pass); Memo1.Lines.Add('Email:'+email2); Memo1.Lines.Add('-------------------------------------------------------------------------------------------------------------'); end; procedure TForm1.FormCreate(Sender: TObject); var FS:TFileStream; begin FS:=TFileStream.Create('captcha.png',FMCreate); IdHTTP1.Get('http://icq-halyava.com/reg.php?get_pic=1.png', FS); FS.Free; end; end.