Re: Telnet to Switch - WeOnlyDo Discussion board

Re: Telnet to Switch (General questions)

by Sandeep, Monday, February 25, 2008, 20:25 (6117 days ago) @ woddrazen

It works if I do not specify the login and password before coonect method. below is the code I used. But I would prefer not having to do these extra steps. The error i receive if I use my previous code is Timeout occurred due to inactivity.

SSH Ssh1 = new SSH();

Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.Telnet;
Ssh1.Port = 10023;
Ssh1.Timeout = 10;
Ssh1.Blocking = true;
Ssh1.Hostname = mydomain ;
Ssh1.Connect();

String a= ;
a = Ssh1.Receive();
Response.Write( <pre> + a + </pre> );
a = Ssh1.Execute( username
,
Enter Password
);
a = Ssh1.Receive();
Response.Write( <pre> + a + </pre> );
a = Ssh1.Execute( password
,

, 10);
a = Ssh1.Receive();
Response.Write( <pre> + a + </pre> );
a = Ssh1.Execute( command
, > , 10);
a = Ssh1.Receive();
Response.Write( <pre> + a + </pre> );
Ssh1.Disconnect();


Complete thread: