Re: How to reload a Cisco Router in C#? (General questions)
Hi,
Still having this problem.
To simplify I have slightly modified the code in Wait For And Execute as follows:
{
WeOnlyDo.Client.SSH Ssh1 = new SSH();
Console.WriteLine( This sample will connect with SSH protocol to the router of your choice and wait until 'cisco871' is found within received data. Hopefully, this is the prompt when new commands can be entered. Then it will enter 'show ver' command, wait for response, and exit. );
Console.WriteLine(
);
Console.Write( Please enter hostname: );
Ssh1.Hostname = Console.ReadLine();
Console.Write( Please enter login: );
Ssh1.Login = Console.ReadLine();
Console.Write( Please enter passowrd: );
Ssh1.Password = Console.ReadLine();
Ssh1.Blocking = true;
Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
Ssh1.Timeout = 10;
Ssh1.Connect();
String a;
a = Ssh1.WaitFor( cisco871# );
// Console.Write(a);
a = Ssh1.Execute( show ver
, cisco871# );
Console.Write(a);
a = Ssh1.Receive();
Console.Write(a);
Ssh1.Disconnect();
}
and I receive the following exception:
WeOnlyDo.Exceptions.SSH.TimeoutException was unhandled
Message= Timeout occurred due to inactivity.
Source= WeOnlyDo.Client.SSH
StackTrace:
at ..(String , Byte[]& , Int32 )
at ..(String , Int32 )
at WeOnlyDo.Client.SSH.WaitFor(String Pattern)
at Wexec.Class1.Main(String[] args) in C:UserscharlieAppDataRoamingWeOnlyDoSampleswodSSH.NETWexec.cs:line 38
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I can allow a remote connection to this router since its a test platform. Please advise.
Complete thread:
- How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-01, 23:46
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 00:02
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 00:41
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 00:46
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 08:58
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 12:20
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 12:42
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 12:45
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 13:49
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 20:03
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 20:11
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 20:46
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 21:39
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 21:57
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 22:01
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-13, 01:53
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-13, 09:13
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-13, 01:53
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 22:01
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 21:57
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 21:39
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 20:46
- Re: How to reload a Cisco Router in C#? - wodDamir, 2008-05-12, 20:11
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-12, 20:03
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 13:49
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 12:45
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 12:42
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 12:20
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 08:58
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 00:46
- Re: How to reload a Cisco Router in C#? - zubenelgenubi, 2008-05-02, 00:41
- Re: How to reload a Cisco Router in C#? - woddrazen, 2008-05-02, 00:02