Board index » delphi » Indy Telnet Server Help

Indy Telnet Server Help

Hi,

Iam trying to make a telnet server but am having a wee bit of trouble. I
have got the server to listen on a port and also take commands. The problem
is when you connect to it i would like it to ask for a username & password.
I have no idea how to do this. I look at the manual but could not work out
what to do i also had alook on the web for an example but still couldnt find
anything. It would be really good if someone could show me an example or
point me in the right direction on getting the infomation i need.

Regards

 

Re:Indy Telnet Server Help


procedure TAutoCDRFrm.TelnetAuthentication(AThread: TIdPeerThread;
  const AUsername, APassword: String; var AAuthenticated: Boolean);
begin
try
  if (AUsername='myusername') and (APassword='mypassword123') then
    AAuthenticated:=True
  else
    begin
      AAuthenticated:=false;
      Exit;
    end;
  AThread.Connection.Write(AUsername);
  AThread.Connection.WriteLn(', Welcome to My Telnet Server.');
  AThread.Connection.WriteLn('');
  AThread.Connection.WriteLn('type ''help'' for help');
  AThread.Connection.WriteLn('');
except
end;
end;

-ioan

Re:Indy Telnet Server Help


Fantastic! Thanks very much

Quote
"Ioan Ghip" <ioan_not.th...@pangea-comm.com> wrote in message

news:3e77f6ac$1@newsgroups.borland.com...
Quote
> procedure TAutoCDRFrm.TelnetAuthentication(AThread: TIdPeerThread;
>   const AUsername, APassword: String; var AAuthenticated: Boolean);
> begin
> try
>   if (AUsername='myusername') and (APassword='mypassword123') then
>     AAuthenticated:=True
>   else
>     begin
>       AAuthenticated:=false;
>       Exit;
>     end;
>   AThread.Connection.Write(AUsername);
>   AThread.Connection.WriteLn(', Welcome to My Telnet Server.');
>   AThread.Connection.WriteLn('');
>   AThread.Connection.WriteLn('type ''help'' for help');
>   AThread.Connection.WriteLn('');
> except
> end;
> end;

> -ioan

Other Threads