Re: Trapping for error and displaying receive buff - WeOnlyDo Discussion board

Re: Trapping for error and displaying receive buff (General questions)

by Eric, Friday, December 07, 2007, 17:25 (6197 days ago) @ Eric

I have no luck with WaitFor and Execute commands. The first Execute times out and does not receive the text looking for. Here is my code:

[code]
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Telnet1 = New WODTELNETDLXCOMLIB.wodTelnetDLXComClass

Telnet1.Timeout = 30

Telnet1.Hostname = textBox2.Text
Telnet1.Login = textBox3.Text
Telnet1.Password = textBox4.Text
Telnet1.Port = 22
Telnet1.Protocol = WODTELNETDLXCOMLIB.ProtocolsEnum.SSHAuto
Telnet1.Blocking = True
Telnet1.StripANSI = True

Telnet1.Connect()

Telnet1.WaitFor( Select: )
Telnet1.DataReady = 0
Telnet1.Execute( T & vbLf, Select : )
Telnet1.DataReady = 0
Telnet1.Execute( e51 & vbLf, (c)Eagle Con&Dev )
Telnet1.DataReady = 0
Telnet1.Execute(vbCrLf, F4-Exit )
Telnet1.DataReady = 0
Telnet1.Execute( s51 & vbLf, Login Password? )
Telnet1.DataReady = 0
Telnet1.Execute( s51eagle & vbLf, F4-Exit )
Telnet1.DataReady = 0
Telnet1.Execute( 51 & vbLf, Select or E? )
Telnet1.DataReady = 0
Telnet1.Execute( 3 & vbLf, F4-Exit )
Telnet1.DataReady = 0
Telnet1.Execute( 3 & vbLf, Select or E? )
Telnet1.DataReady = 0
Telnet1.Execute( bkn & vbLf, F4-Exit )
Telnet1.DataReady = 0
Telnet1.Execute( wrkrb & vbLf, F4-Exit )
End Sub
[/code]

I was able to get further with Prompt method as listed above. This current way is cleaner from a coding point of view and would be nice to get working.


Complete thread: