Tutorials on .NET 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). 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.

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 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, well, well... whatever name it is: the MFC/C++-CLI/VB .NET/C#/C crap/C++ crap... 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 for fun, jump and run...

The C++ .NET in the latest version (look likes there is a never ending .NET framework version lor!) of the .NET framework is based on the C++/CLI. At the end, after a 'suck evolution', the 'stable version', the Managed Extension for C++ => Managed C++ => C++ .NET => C++/CLI => another crap version (believe us!) ~> WCF. The CLI is Microsoft extension to the standard C++ (2003). Other C++ codes for network programming might use the third party libraries or APIs. Well, as a technology slave, what can we do huh? Which one should you use? Instead of talking to the 'wall', it is better you ask yourself: What skill do I have? What application that will I develop? On what platform? Support? Portability? Life cycle? Budget? Timeframe?...so on...so on... You can start now!

 

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, by Anthony Jones and and Jim Ohlund. These tutorials try to concentrate on the code examples part and for the information part, you must refer to MSDN C/C++ because it is updated regularly making the info outdated fast. However, this step-by-step tutorial with tons of screenshots and program examples output samples have been refined for better usability. All code has been recompiled using Visual Studio 2008 Express Edition (free)/Visual Studio 2008 Professional Edition (free for trial version) and using .NET framework 3.5. All the credit, copyright and related thingy must go to the original authors and publisher and before you 'shoot' somebody, please, don't forget to read the disclaimer, and privacy too.

Most of the program examples also include the C++ .NET (C++-CLI huh?) which are missing in the original book. 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 practising 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, you can continue!

 

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 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 2008 Express Edition – free or

  4. Visual Studio Component Express 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 Concepts Anymore

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.

Home

 

 

About

 

C & Linux Socket

 

C & Winsock Kick Start

 

A Complete & Advanced C & Winsock 2 Programming

 

C++, MFC & Winsock (+WinInet)

 

 

Visual C++ .NET Programming

 

 
COMPLETED PROJECT DOWNLOAD

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

Copyright 2009 © winsocketdotnetworkprogramming.com. All rights reserved.

Excellent hosting services for winsocketdotnetworkprogramming provided by MochaHost - The Online Central

DISCLAIMER  |  PRIVACY | CONTACT |

 
Custom Search