C# Code Snippets

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search

C# Code snippets / C# Examples / C# Samples

A C# code snippet is a brief example of useful C# source code or Visual C# source code. Sometimes called a recipe, a code snippet usually performs a single function. Being mere fragments of C# source code, the snippets often omit the required using statements. C# source code snippets are categorized alphabetically by namespace. So, place your fully functional C# methods in our C# source code bankC# source code respository or C# cookbook—for all to share.

Contents


Microsoft.Win32 namespace

System namespace

  • Use enumerations - illustrates the declaration and use of enumerated types (enum keyword).

System.Collections namespace

  • Enumerate an array - enumerate over the elements of a multidimensional array using the IEnumerator interface.

System.Collections.Generic namespace

System.Data.SqlClient namespace

System.DirectoryServices namespace

System.IO namespace

System.Management namespace

System.Media namespace

System.Net namespace

  • HTTP Post - send an HTTP Post and get the response.
  • System.Net.Mail - SMTP e-Mail functions.

System.Reflection namespace

System.Runtime.InteropServices namespace

System.Security.Principal namespace

System.Text.RegularExpressions namespace

System.Threading namespace

System.Windows.Forms namespace


See also





Personal tools