Hi all,

I found the following code on the internet. This code is running with the SunSolaris 5.9 telnet server, but
if I omit the "RD" part after any commands, that is not running. I mean connection to the server side is okey but
there is something wrong with the authentication part.
Thanks

procedure TForm1.BitBtn1Click(Sender: TObject);
var TN : TTelnetSend;
procedure Rd;
var S : String;
procedure Strip0;
var I : Integer;
begin
i:=1;
while i<=Length(S) do
begin
if (S[i]=#0)and (S[i-1]=#13)
then System.Delete(S,i-1,2)
else Inc(i);
end;
end;

begin
S:=TN.RecvString;
while S<>'' do
begin
Strip0;
Memo1.Lines.Add(S);
S:=TN.RecvString;
end;
end;

begin
TN:=TTelnetSend.Create;
TN.TargetHost:='IP Address';
TN.TargetPort:='23';
TN.Timeout:=1000;
Memo1.Lines.Clear;
TN.Login;
RD;
TN.Send('username'+#13#10);
RD;
TN.Send('password'+#13#10);
RD;
TN.Send('ls -al'+#13#10);
RD;
TN.Logout;
TN.Free;
Memo1.Lines.Add('Done');
end;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to