Mar 3, 2011
I'm currently making a code that will login to a cisco router, and show the version, then return the version to me. The connection to the cisco router is using telnet, and I'm using Dimac's w3Sockets code to Connect, login, and return data. Reference
View 5 Replies
But currently I'm having some problems, since the router sometimes need the login typed 2 times, or having a key pressed to update the terminal(telnet),meaning i have to check if it gets logged in or not. But the problem is that using dimac code, i can only wait() and waitFor(), and if it none data comes whilst waiting, it keeps on waiting. Is there away to do like: "if wait fails goto"
I've tryed "on error goto", but since its not a error, but just keeps waiting, that dont work. Also, To locate where it gets stuck I have it write to my textbox everytime it takes a step in the code, but its like the dimac code overtakes vb.net. ex: If i send some text to a textbox in the same sub as the connect code is, and it gets stuck at a wait, it dont even write to the textbox, eventhough the textbox.text command was suppose to execute before the wait().
Private Sub telnet(ByVal port)
TextBox3.Text = TextBox3.Text & Environment.NewLine & "Telnet func Called" 'Cant execute this if it gets stuck at login below. ??