Dart Home | PowerTCP Telnet for .NET | Custom Development | Reply | PowerTCP Telnet for .NET Topics | Forums |
Author | Forum: PowerTCP Telnet for .NET Topic: Display real time data |
lroberts From: Grand Rapids, MI USA Posts: 13 Member Since: 03/24/06 |
posted April 1, 2006 3:49 AM I am attempting to figure out how to get data displayed in real time in a textbox so that I can see how the ping that I am doing is progressing. I can't seem to figure it out. How can I tell Telnet1 to display all data in a textbox on my form? Here is my code below. Thank you Imports System.IO Imports Dart.PowerTCP.Telnet Public Class Form1 Private Sub textDisplay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Telnet1.ClientOptions.Remove(Telnet1.ClientOptions(OptionCode.TerminalType)) Telnet1.ReceiveTimeout = 9000 Telnet1.Connect("10.207.254.124") Dim a As String = Telnet1.WaitFor("Username:") TextBox1.Text = TextBox1.Text + a Telnet1.Send("lroberts" + Chr(10)) Dim c As String = Telnet1.WaitFor("Password:") TextBox1.Text = TextBox1.Text + c Telnet1.Send("25034" + Chr(10)) Dim u As String = Telnet1.WaitFor(">") TextBox1.Text = TextBox1.Text + u Telnet1.Send("enable" + Chr(10)) Dim io As String = Telnet1.WaitFor("Password:") TextBox1.Text = TextBox1.Text + io Telnet1.Send("magic" + Chr(10)) Dim yut As String = Telnet1.WaitFor("#") TextBox1.Text = TextBox1.Text + yut Telnet1.Send("ping ip" + Chr(10)) Dim tty As String = Telnet1.WaitFor("address:") TextBox1.Text = TextBox1.Text + tty Telnet1.Send("10.195.5.5" + Chr(10)) Dim add As String = Telnet1.WaitFor("[5]:") TextBox1.Text = TextBox1.Text + add Telnet1.Send("25" + Chr(10)) Telnet1.Send(Chr(10)) Telnet1.Send(Chr(10)) Telnet1.Send(Chr(10)) Telnet1.Send(Chr(10)) If (Telnet1.WaitFor("#").IndexOf("!") > -1) Then Label1.Text = "Pass!" Else Label1.Text = "Fail" End If End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub End Class |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted April 3, 2006 2:51 PM What happens when you run that code? |
Reply | PowerTCP Telnet for .NET Topics | Forums |
This site is powered by
![]() |