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

  • 10 Rules that Make or Break Enterprise App Development Projects In today's app-driven world, application development is a top priority. Even so, 68% of enterprise application delivery projects fail. Designing and building applications that pay for themselves and adapt to future needs is incredibly difficult. Executing one successful project is lucky, but making it a repeatable process and strategic advantage? That's where the money is. With help from our most experienced project leads and software engineers, …

  • The first phase of API management was about realizing the business value of APIs. This next wave of API management enables the hyper-connected enterprise to drive and scale their businesses as API models become more complex and sophisticated. Today, real world product launches begin with an API program and strategy in mind. This API-first approach to development will only continue to increase, driven by an increasingly interconnected web of devices, organizations, and people. To support this rapid growth, …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds