C#

How To Implement Chain of Responsibility Design Pattern in C#

What is Chain of Responsibility Design pattern? The chain of responsibility pattern is a behavioral software design pattern that implements the Requestor/Handler architecture using a chain of handlers. Each handler can do its o…

How to update JSON value in C#

JSON is a lightweight data-interchange format that’s easy for both humans and computers to read and write. It’s based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. In this ar…

How can I use async with foreach in C#

This blog post will show you how to await the foreach loop in C#. Onwards c#, we can use async foreach in our code. To use async foreach, your method must return IAsyncEnumerable<T>. Let’s understand it with one example…

RSA encryption/decryption C# example

In this blog post I will discuss about encryption and decryption in C#. There are a lot of algorithms for encryptiong and decrypting the data but here I am going to discuss about RSA encryption algorithm. By the end of this blo…

How to extract number from string using Linq

Imagine you have an s tring("ABCDE99F-J74-12-89A") , and you want to extract the only number from the string. This snippet will show how to extract numbers from strings. using System ; using System . Collections . G…

C# Boyer-Moore String Search Example

In this article, I will show you the implementation of the Boyer-Moore algorithm. By the end of the post you will learn What is Boyer-Moore string search algorithm? How to implement Boyer-Moore string search algorithm in …

Delete node from linked list with specific value

In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collecti…

Measure The Performance Of Your .NET Code Using BenchmarkDotNet

As developers, we are sometimes challenged with making a specific piece of code run quicker. We frequently need to pick which piece of code performs the best. Benchmarking gives us concrete measurements between different portion…

Encrypt and Decrypt a String in C# Using Asymmetric Encryption

There are two classes for asymmetric encryption in .net. RSACryptoServiceProvider and DSACryptoserviceProvider . Both classes automatically create the public and private keys necessary to encryption and decryption with the defau…

C# Program To Print All the IP Addresses of the Given Website

In this code snippet, I will show you how to print all the IPV4 addresses of any website using C#. For this, you have to call the static method GetHostAddressesAsync on Dns class. It will return an Array of IPAddress . Check o…

Disposal and garbage collection in C#

In this post, I will discuss the most important concept of C#, called garbage collection. What garbage collection? Garbage collection is a non-deterministic background thread that scans objects in memory on a regular basis and…

تحميل المزيد من المشاركات
لم يتم العثور على أي نتائج