How to write your own Telnet Server in VB5/6

This is a simple TELNET server supporting only one user and one comnection at a time. The Program can be enhanced for multiple user and for multiple users at a time.

The image below shows the interface to the Telnet client through the Microsoft Telnet program:

Telnet screenshot

Server Side Setup

Compile the supplied application and run it!

Client Side Setup

You can use the same machine or go to the other machine to test your server.

  • Go to the RUN prompt of your windows type TELNET.
  • In the telnet's Connect menu option select Remote System...
  • Now enter the ip address of the computer where your telnet server (demo application) is running in the Host Name option (or you can just enter your Computer Name)
  • Enter 23 or default value in the Host edit box
  • Press Enter

Yes, there comes your login screen. You can login to the sample telnet server using:

Login Name : sanjeev
Password : siri

Typing HELP at the prompt will give you a list of commands accepted by the client.

Download zipped project file (3k)


  • very nice for srudents

    Posted by Legacy on 01/15/2004 12:00am

    Originally posted by: mukesh bhootra

    it is very nice sir

  • Thank you!

    Posted by Legacy on 12/13/2003 12:00am

    Originally posted by:

    Awesome! I needed something as basic as this to help me with a project of mine that involves a telnet server. Good job.

  • how i can ?

    Posted by Legacy on 10/19/2003 12:00am

    Originally posted by: hanh

    i now working for a post office, alway contact to a telephone exchange ( neax61). i want to write my own program to connect to the telnet and implemente orders relating to telephone exchange. help me!

  • Very Useful - thanks a lot

    Posted by Legacy on 11/30/2002 12:00am

    Originally posted by: Madhu Gumma

    Very Useful - thanks a lot

  • I want to telnet for client.!

    Posted by Legacy on 07/27/2002 12:00am

    Originally posted by: lsjch

    I want to telnet for client.! giving me to ,

  • Very Useful - thanks

    Posted by Legacy on 07/04/2002 12:00am

    Originally posted by: Simon Ruffle

    Thanks for this code, it got me started on solving a problem that needed telnet access. I do not understand some of the criticism on this page...OK its simple, but it works, and can be used as a basis for onward developing code. I had this working within a minute or 2 of putting in the Google query "visual basic telnet server". It saved me time working out how to get the winsock control to work.

  • thnx d00d!

    Posted by Legacy on 06/19/2002 12:00am

    Originally posted by: Darksun

    yo I was trying to create something exactly like this! to those who say it's a waste of time don't read it!it roxzorz!

  • Sendig escape chars

    Posted by Legacy on 02/28/2002 12:00am

    Originally posted by: Lucio Lopez

    I'm trying to send a command that contains a ']' character, and after that VB winsock control closes the connection. And it does that closing without receiving anything at the ReceiveData event.

    Does anybody knows how to send this special character?

    Thanx in advance.

  • with no time..this helped!

    Posted by Legacy on 07/12/2001 12:00am

    Originally posted by: Yasir

    Very new to VB (1 week), and needed to build a quick TCP server component with customized commands. This was a great help, it saved me a lot of reading and compile time.Thanx.

  • TelNet client

    Posted by Legacy on 04/29/2001 12:00am

    Originally posted by: Klaus Karkov

    Hi Sanjeev
    I have tried your telnet server VB thing, and seems to work just fine. But I was actually looking for a Client application.
    Basically I just want to create an application where I can control a standard RS232 port via a TelNet connection. Do you know of anyone who might have this kind of VB program.

    Best Regards,

    Klaus Karkov

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Cybercrime is getting big and bigger. 2013 was the year of the Mega Breach with eight top data breaches resulting in the loss of tens of millions of data records. Criminals are always looking for vulnerabilities to exploit. Applications are already becoming a target. Is signing code and apps the answer to protecting our users from malware in applications? Are there any challenges with code signing? In this program we answer those questions and more with two of the industry's leading experts -- Mario de …

  • Live Event Date: August 14, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Data protection has long been considered "overhead" by many organizations in the past, many chalking it up to an insurance policy or an extended warranty you may never use. The realities of today make data protection a must-have, as we live in a data driven society. The digital assets we create, share, and collaborate with others on must be managed and protected for many purposes. Check out this upcoming eSeminar and join eVault Chief Technology …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds