Telnet clients connect to a server on the Internet or within your local network; so you can configure the server from your desktop. You can create your own Telnet client using the Visual Basic 6 language. You must use the Telnet client control, which is a part of the VB6 compiler.
- Skill level:
Other People Are Reading
Click the Windows "Start" button, and type "visual basic 6" in the search text box. Press "Enter" to open the Visual Basic software.
Click the "Project" menu item, and select "References." A list of ActiveX components you can insert into your program is displayed. Check the box labelled "ActiveSocket" and click "OK" to add it to your project.
Right-click the VB code file you want to use to connect to the Telnet server. Click "View Code." Type the following code to create a Telnet class variable:
Public telnet As ASOCKETLib.Tcp
Set telnet = CreateObject("ActiveXperts.Tcp")
Create the Telnet connection. The following code makes a connection to the server "tserver" on port 23, which is the default Telnet server port:
telnet.Connect "tserver", 23
Send a command to the server. You use the "SendText" function to send a command to the server. The following code sends the "dir" command, which lists the files and directories on the server:
Close the connection to the server. After you finish sending commands to the server, you must close the connection to complete the service. Use the following code to close the connection:
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for