Re: Trapping for error and displaying receive buff (General questions)
[size=2]Success[/size]
I wanted to update this post as I have found a solution using the prompte method.
[code]
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Telnet1 = New WODTELNETDLXCOMLIB.wodTelnetDLXComClass
Telnet1.Timeout = 4
Telnet1.Hostname = textBox2.Text
Telnet1.Login = textBox3.Text
Telnet1.Password = textBox4.Text
Telnet1.Protocol = WODTELNETDLXCOMLIB.ProtocolsEnum.Telnet
'Telnet1.Port = 22
Telnet1.Blocking = 1
Telnet1.StripANSI = True
Telnet1.Prompt = p5104 - Select:
ExecCount = 0
Telnet1.Connect()
End Sub
Private Sub AddToList(ByVal Text As String)
textBox1.AppendText(Text)
End Sub
Private Sub Telnet1_Connected(ByVal ErrorCode As Short, ByVal ErrorText As String) Handles Telnet1.Connected
If ErrorCode <> 0 Then
AddToList( CONNECT error: & ErrorText & vbCrLf)
Else
AddToList( CONNECTED! & vbCrLf)
End If
End Sub
Private Sub Telnet1_Disconnected() Handles Telnet1.Disconnected
AddToList( DISCONNECTED & vbCrLf)
End Sub
Private Sub Telnet1_PromptReceived() Handles Telnet1.PromptReceived
Select Case ExecCount
Case 0
AddToList(Telnet1.Prompt)
Telnet1.Prompt = p5104 - Select:
Telnet1.Send( T & vbCrLf)
Case 1
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Dev
Telnet1.Send( e51 & vbCrLf)
Case 2
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Exit
Telnet1.Send(vbCrLf)
Case 3
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Password
Telnet1.Send( s51 & vbCrLf)
Case 4
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Exit
Telnet1.Send( s51eagle & vbCrLf)
Case 5
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Select
Telnet1.Send( 51 & vbCrLf)
Case 6
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Select
Telnet1.Send( 3 & vbCrLf)
Case 7
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Select
Telnet1.Send( 3 & vbCrLf)
Case 8
AddToList(Telnet1.Prompt)
Telnet1.Prompt = Employee
Telnet1.Send( bkn & vbCrLf)
Case 9
AddToList(Telnet1.Prompt)
Telnet1.Send( wrkrb & vbCrLf)
End Select
ExecCount = ExecCount + 1
End Sub
Private Sub Telnet1_Received(ByVal ByteCount As Short) Handles Telnet1.Received
Dim a As String
a = Telnet1.Receive(ByteCount, 0)
AddToList(a)
End Sub
[/code]
[size=2]Problems Found with Resolutions[/size]
Problem 1: ANSI Characters were causing the prompts to fail
Resolution 1:used strip ANSI to resolve issue
Problem 2: SSHAuto would not let script complete due to some characters not encoding properly
Resolution 2:Converted to Telnet Protocol
Problem 3: Sent data was not always working with menus
Resolution 3:Made sure all send data appended vbCrLf rather than vbLf
Complete thread:
- Trapping for error and displaying receive buffer a - Eric, 2007-12-07, 14:32
- Re: Trapping for error and displaying receive buff - wodDamir, 2007-12-07, 15:32
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:12
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 16:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:46
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:25
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 17:30
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:45
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:22
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:26
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:32
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:39
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:52
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 20:06
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 20:29
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 21:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:03
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 22:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 14:55
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-10, 15:09
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 15:21
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 16:05
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 15:21
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-10, 15:09
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 14:55
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 22:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:03
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 21:18
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 20:29
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 20:06
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:52
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:39
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:32
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:26
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:22
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:45
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 17:30
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:25
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:46
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 16:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:12
- Re: Trapping for error and displaying receive buff - wodDamir, 2007-12-07, 15:32