.NET Framework : CLR
An introduction to Common Language Runtime The Common Language Runtime (CLR) is a virtual machine environment and part of the .NET Framework. It contains: A portable…
.NET Framework : Acronym Glossary
.Net Related Acronyms Please note that some terms like JIT and GC are generic enough to apply to many programming language environments and runtimes. CLR: Common…
.NET Framework : Synchronization Contexts
Execute code on the UI thread after performing background work This example shows how to update a UI component from a background thread by using a SynchronizationContext…
.NET Framework : Serial Ports
Basic operation var serialPort = new SerialPort("COM1", 9600, Parity.Even, 8, StopBits.One); serialPort.Open(); serialPort.WriteLine("Test data");…
.NET Framework : Work with SHA1 in C#
in this project you see how to work with SHA1 cryptographic hash function. for example get hash from string and how to crack SHA1 hash. source compelete on github:…
.NET Framework : JSON Serialization
Deserialization using System.Web.Script.Serialization.JavaScriptSerializer The JavaScriptSerializer.Deserialize<T>(input) method attempts to deserialize a…
.NET Framework : File Input/Output
VB WriteAllText Imports System.IO Dim filename As String = "c:\path\to\file.txt" File.WriteAllText(filename, "Text to write" & vbCrLf) VB…
.NET Framework : Dependency Injection
Dependency Injection – Simple example This class is called Greeter. Its responsibility is to output a greeting. It has two dependencies. It needs something…
.NET Framework : Reading and writing Zip files
The ZipFile class lives in the System.IO.Compression namespace. It can be used to read from, and write to Zip files. Listing ZIP contents This snippet will list…
.NET Framework : System.Reflection.Emit namespace
Creating an assembly dynamically using System; using System.Reflection; using System.Reflection.Emit; class DemoAssemblyBuilder { public static void Main() { //…
.NET Framework : Task Parallel Library (TPL)
Basic producer-consumer loop (BlockingCollection) var collection = new BlockingCollection<int>(5); var random = new Random(); var producerTask = Task.Run(()…
.NET Framework : Task Parallel Library (TPL) API Overviews
Perform work in response to a button click and update the UI This example demonstrates how you can respond to a button click by performing some work on a worker…
.NET Framework : Globalization in ASP.NET MVC using Smart internationalization for ASP.NET
Basic configuration and setup Add the I18N nuget package to your MVC project. In web.config, add the i18n.LocalizingModule to your <httpModules> or <modules>…
.NET Framework : Regular Expressions (System.Text.RegularExpressions)
Check if pattern matches input public bool Check() { string input = "Hello World!"; string pattern = @"H.ll. W.rld!"; // true return Regex.IsMatch(input,…
.NET Framework : DateTime parsing
ParseExact var dateString = "2015-11-24"; var date = DateTime.ParseExact(dateString, "yyyy-MM-dd", null); Console.WriteLine(date); 11/24/2015…
.NET Framework : Threading
Accessing form controls from other threads If you want to change an attribute of a control such as a textbox or label from another thread than the GUI thread that…