Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,459 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,136 people online right now. Registration is fast and FREE... Join Now!




Launching Telnet from .NET 2005

 
Reply to this topicStart new topic

Launching Telnet from .NET 2005, Trying to code a telnet window to open with user specified parameters

souptoy
23 Jan, 2008 - 02:50 PM
Post #1

New D.I.C Head
*

Joined: 17 Jan, 2008
Posts: 23



Thanked: 1 times
My Contributions
Hi all, stumbled across this forum about a week ago and it's great. My problem is this: I am trying to launch Telnet sessions from a form I've created using OOP and user specified criteria (host, port) and it's launching the program and then closing automatically. If I take the parameters out, the Telnet window launches and stays up. Interesting thing is that if you launch Telnet from the run command with parameters it will do what it does with my WinForm but if you launch it from the CLI then it stays up. This is using Visual Basic btw.

I guess what I'm asking is whether there is a way to launch it without calling cmd.exe?

Here's the code:

CODE

If radioTelnet.Checked = True Then
            Dim aTelnet As New Telnet
            Dim host, port As String

            'Set application to Telnet and configure host parameters
            aTelnet.App = "telnet.exe"
            aTelnet.Host = "o " & Me.txtHost.Text
            host = aTelnet.Host
            aTelnet.Parameters = host

            'Configure port parameters <<default to 23 if no port is specified)
            If Not (Me.txtPort.Text = Nothing) Then
                aTelnet.Port = " " & Me.txtPort.Text
                port = aTelnet.Port
                aTelnet.Parameters = port
            Else
                aTelnet.Port = " 23"
                port = aTelnet.Port
                aTelnet.Parameters = port
            End If

            aTelnet.LaunchApp()
        End If


This post has been edited by souptoy: 23 Jan, 2008 - 02:55 PM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Launching Telnet From .NET 2005
24 Jan, 2008 - 07:18 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,477



Thanked: 161 times
Dream Kudos: 9025
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I would start by looking into the System.Diagnostic.Process Class for doing this, it may work better. For a small example on how its used I wrote a snippet than performs an XCOPY in VB.Net.

This approach may help the most (I know it sucks to scrap code, but unless you're a long time programmer, get used to it lol tongue.gif )
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 01:42PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month