1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
Command: String;
begin
if (Connected) then
begin
Connected := False;
AThread.Connection.Write('220 Connection successful'+chr(13)+chr(10));
end
else
begin
Command := AThread.Connection.ReadLnWait;
if ( (midStr(Command, 0, 4) = 'USER') ) then
begin
AThread.Connection.Write('331 Password required for '+
MidStr(Command, 5, Length(Command) )+chr(13)+chr(10) );
end;
RichEdit1.Lines.Add(Command);
Application.ProcessMessages;
end;
end; |