954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how do i telnet to an ip address from vb.net code

Hi guys im trying to telnet to an IP address that is entered into a textbox from the click of a button but im having problems as it just gives me errors when i run it. Here is my code:

Private Sub btnTelnet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTelnet.Click

        Dim telnet As Process = New Process
        telnet.StartInfo.FileName = "telnet.exe"
        telnet.StartInfo.Arguments = "o" + txthostname.text
        telnet.StartInfo.WindowStyle = ProcessWindowStyle.Normal
        telnet.StartInfo.CreateNoWindow = True
        telnet.Start()
    End Sub


without the "telnet.StartInfo.Arguments = "o" + txthostname.text" command it just opens telnet but with the code it says "unexpected error continue or quit".

Any help would be great
Cheers

ivabigun
Newbie Poster
10 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

Hi

What does the "o" argument do? I think the problem is to do with this argument, if you want telnet to just connect to a host then just pass the hostname.text as the argument without the "o"

Hope this helps

Kev

kevinwebster83
Newbie Poster
12 posts since Mar 2008
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You