Tutorials on Windows Network Programming With Working C#, VB .NET and C++/CLI .NET Code Examples
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
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
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:
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...
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.
Share and email to your friends and foes: