Fading Coder

One Final Commit for the Last Sprint

Core Concepts of Object-Oriented Programming in C#

Inheritance and Class Hierarchies Inheritance is a fundamental pillar of Object-Oriented Programming (OOP) that allows a class (derived or child class) to acquire the members of another class (base or parent class), with the exception of private members. This mechanism promotes code reusability and...

Constructing Tree Structures via Recursion in C#

Processing hierarchical datasets frequently necessitates transforming a flat collection into a nested tree format. In C#, recursion provides an efficient mechanism to traverse parent-child relationships defined by identifiers. The following implementation demonstrates how to retrieve complete sub-st...

Panasonic PLC Modbus RTU Communication via NModbus4 in C#

Hardware Wiring & PLC Settings RS-485 Connection Connect the PLC’s RS-485 terminals: + to converter +, – to converter –. On some Panasonic models, jumper terminal E to –. DIP-Switch Baud Rate Switch 1-4 Baud Data bits Stop bits Parity 1=ON 9600 8 1 None 2=ON 19200 8 1 Even 3=ON 38400 8 1 Odd 4=O...

Effective HttpClient Usage in C#

The HttpClient class in C# serves as a session for making HTTP requests. An instance of HttpClient holds a collection of settings applied to all requests originating from it. Importantly, each HttpClient instance manages its own connection pool, isolating its requests from those made by other HttpCl...

Building a WebSocket Server with Fixed Header Protocol in SuperSocket 2.0

This article demonstrates how to create a WebSocket server using SuperSocket 2.0 with a fixed header protocol. The implementation leverages several key components including PackageInfo, PackageMapper, IAsyncCommand, WebSocketSession, and MiddlewareBase to construct a fully functional WebSocket serve...

Understanding Deep Copy and Shallow Copy in C#

Copy Semantics Overview Object copying is a fundamental concept in C# that frequently appears in technical discussions and interviews. All .NET types inherit from System.Object, which provides a protected method MemberwiseClone() that performs what is known as a shallow copy. Shallow Copy A shallow...

Inter-Form Communication in C# WinForms

Parent-Child Form Communication 1. Pass Values with Public Static Variables Main form (MainForm) code: public partial class MainForm : Form { // Declare a public static variable to hold station ID public static string stationId = string.Empty; // Assign value to the static variable during initializa...

Implementing RabbitMQ Topic Exchange with Wildcard Routing

Topic exchanges enable flexible messsage routing using wildcard patterns. The binding keys support two special chaarcters: * matches exactly one word, while # matches zero or more words. Publishing Messages with Topic Exchange public void PublishTopicMessages() { var connectionHelper = new MQHelper(...

C# XML Configuration File Read and Write Operations

XML files serve as excellent configuration sources due to their human-readable structure. Unlike INI files, XML supports complex nested configurations including lists and hierarchical data structures, providing greater flexibility for application settings. Working with XML in C# The System.Xml names...

Inter-Process Communication in C# Using Shared Memory

MemoryMappedFile in .NET The MemoryMappedFile class serves as the foundation for shared memory operations in .NET. Creating a shared memory segment requires specifying a unique name and size allocation. // Initialize shared memory segment MemoryMappedFile mappedFile = MemoryMappedFile.CreateNew(mem...