Tutorials on Windows Network Programming With Working C#, VB .NET and C++/CLI .NET Code Examples







C & Linux Socket


C & Winsock Kick Start


A Complete & Advanced C & Winsock 2 Programming






C++, MFC & Winsock (+WinInet)


Visual C++ .NET Programming


Chilkat Visual C++/.NET Code Examples


Win32, C & Unicode Code Examples




Completed Project Download page 1 (79)




Completed Project Download page 2 (70)




Completed Project Download page 3 (25)



ReactOS - Windows OS Binary Compatible Open Source Project - C & C++


Based on the legacy system developed in the computer world, many networking program examples are in C codes that include the UNIX/Linux Socket. For Windows platform, before the .NET, network programming is based on the Winsock/Winsock2 that uses the C codes (standard C + Microsoft extension for C). Winsock 1 is based on the Berkeley Socket. The Winsock2 codes contains the Win32 API. Winsock is still there, 'wrapped by' .NET framework with more features. It is obvious if you use classes from the System.Net.Sockets namespace. Take note that these tutorials are based on the Windows socket 2 and .NET APIs and not 'through' the Windows Driver Kits (WDK).

There are many people searching the C++ codes for the Winsock programming on the Internet. To develop Windows GUI based networking using C++, you may need to learn and use the classes available in Microsoft Foundation Class (MFC) or find the latest MFC version in VS 2008 with 3.5 or latest framework. Other uses the third party C++ networking libraries/APIs. You may want to consider the C++ networking API/libraries, free and commercial that can be searched at C/C++ API/Libraries collections. Well, whatever name it is: the MFC/C++-CLI/VB .NET/C#/C, is nothing other than wrappers of the C sockets with extra 'features' too, and still based on the TCP/IP stack/OSI. However there is no reason for you not to use the .NET framework for the network programming for newer Windows platforms. At least, as shown in this tutorials, it is just for fun learning.

The C++ .NET in the 'latest version' of the .NET framework is based on the C++/CLI. At the end, the 'stable version', the Managed Extension for C++ => Managed C++ => C++ .NET => C++/CLI => another version  ~>WCF. The C++/CLI is Microsoft extension to the standard C++ (2003). Other C++ codes for network programming might use the third party libraries or APIs such as Chilkat libraries and components...


Part I - General Concepts With Code Implementations




Chapter 1:       Network Programming with the Microsoft .NET Framework

Chapter 2:       Managed I/O: Streams, Readers, and Writers

Chapter 3:       Threading and the Asynchronous Pattern

Chapter 4:       .NET Serialization Techniques

Chapter 5:       Developing with Uniform Resource Identifiers (URIs)

Back to this site, it is a repository of code samples and examples for network programming using .NET framework based on the outdated version of the Network Programming for Microsoft Windows, 2nd Edition (here) and Network Programming for the Microsoft .NET Framework (this tutorial) by Anthony Jones, Jim Ohlund and Lance Olson. However, these tutorials try to concentrate more on the code examples part and the sample outputs (which are lacking in those books coupled with no updates and new editions).

For the information part, you must refer to MSDN C/C++/VB .NET/C# because it is updated regularly making the info may outdated fast. This step-by-step tutorial with tons of screenshots and program examples output samples have been refined for better learning. All code has been recompiled using Visual Studio Community Edition (free)/Visual Studio Professional Edition (free for trial version) and using .NET framework 3.5. All the credit, copyright and related things must go to the original authors and publishers and please, don't forget to read the disclaimer, and privacy too.

Most of the program examples also include the C++ .NET (C++/CLI huh?). The .NET framework used is 3.5 and all the obsolete classes/methods have been replaced by newer one. All the program examples include a step-by-step with sample outputs. Code samples dominated by C# and VB .NET. It is not just learning the network part of the .NET programming, by going through the step-by-step, you will also get familiar with the .NET programming as a general.

You will learn on how to create and use the .NET classes, properties, defining and using new classes, calling methods/subroutines/functions, creating several type of projects such as class libraries (DLL), console mode applications, simple Windows forms (Windows GUI) and a very simple web applications. After some time of practicing those tutorials, hopefully, you will get the impression that C# is closely 'similar' to C++ .NET. Hence, it should be 'easy' to convert the C# code to C++ .NET and vice versa. Well...


Part II - Using the Network With Code Implementations



Chapter 6:       An Introduction to System.Net Namespace

Chapter 7:       An IP Addressing and DNS

Chapter 8:       The Client Sockets (Winsock)

Chapter 9:       The Server Sockets (Winsock)

Chapter 10:     HTTP with .NET

The project types used in this tutorial dominated by the console mode application, done intentionally, forcing the learner to grasp the fundamental or basic principle and concept. Considering the project types developed for the program examples, depending on your needs, you should change the project type accordingly to a class library or Windows Form application. Before starting any coding, review the specification/environment used for all the program examples:

  1. Windows XP Pro SP2 (few done on Windows 2003 Server Standard Edition).

  2. Intel Core 2 Duo with 2GB RAM.

  3. Visual Studio Community Edition – free or

  4. Visual Studio Component Community Edition – VB .NET, C#, VC++ etc. - free.

  5. Visual Studio (Free trial).

  6. .NET Framework 3.5.

  7. The general Visual C++ .NET/C++-CLI programming tutorial which includes WinForm can be found at Visual C++ .NET programming tutorial.

  8. Install and use Visual Studio 2008.

  9. Download, install and verify Visual Studio 2008 SP1

  10. Download and install Visual Studio 2008 Express Edition: C#, VB, C++ and Visual Web Developer. Some info on MSSQL Express Edition database also included.

  11. Other VS versions install/setup.

  12. Install, setup, configure and use the IIS 5.x web server as the test bed for the program examples created in most chapters.


Most of the program examples were run or tested on local machine (localhost) and this localhost, most of the time was connected to the Internet. This means, the client and server or sender and receiver programs were run on the same machine. Some examples were run from different paths on the same machine. Some were tested on the private network, running the client and the server programs on different hosts. Well, let continue with more crap!


Part III - Advanced But Not So Advanced...

Chapter 11:       The XML Web Services and the Network

Chapter 12:       The .NET Remoting

Chapter 13:       The .NET Framework Network Security

Chapter 14:       Network Performance and Scalability

Chapter 15:       Advancements in .NET Framework Networking



Other than we need to use the .NET framework, in these tutorials, there are no information and program examples for the Windows OS 'network' itself such as for Windows system programming, accessing Windows system resources through network etc. which normally found in the Win32 programming.





Broken link? Respond to Webmaster: [The Windows network programming tutorial - VB .NET, C# & C++ .NET]

Copyright 2019 © winsocketdotnetworkprogramming.com. All rights reserved.


Excellent hosting services for winsocketdotnetworkprogramming provided by: Windows/Linux VPS Plans from $11.17/month



Custom Search

Share and email to your friends and foes:


This website is using cookies. Click for more info. That's Fine