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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.