C# Programming Tutorials

C Sharp Programming Tutorials And Articles
  Title / Author Replies
Introduction Commenting in any programming langauge is important part of development because it helps understanding the code better and supplements when working as a part of the large team and so C# being a langauge of the modern era has some of the best support any project needs as far as the...
Delegate.Invoke Delegate.Invoke is used to execute a delegate on the current thread. A delegate is just a reference to a function or method, and Delegate.Invoke is the mechanism to call this function or method (similar to a normal function call). Delegate.BeginInvoke Delegate.BeginInvoke...
Introduction Before designing a class, we should have a very clear understanding about constructor. In this article I will discuss definition, types and features of constructor. Definition A constructor looks like a special method having no return type and its name is same with the class...
Introduction Exceptions are unforeseen errors that happen in your programs. Most of the time, you can, and should, detect and handle program errors in your code. For example, validating user input, checking for null objects, and verifying the values returned from methods are what you expect, are...
Introduction I happen to edit the collections many times in the foreach loop and run into problems and then each time I got a different solution when going to Google, So first I would try to list each of the solution and then discuss them so that we all can have the best practice in the...
If you program in more than one language, sometimes you want to use an phrase or expression from one language in the other, when it does not exist you have to invent it for that language. Nested functions are functions defined within functions. They can be useful for compartmentalizing behavior...
When Windows developers need a unique value, they often utilize a Globally Unique Identifier (GUID). Microsoft uses the term GUID for a unique number that identifies an entity, such as a Word document. A GUID is a 128-bit integer (16 bytes) that you can use across all computers and networks...
Class overview Microsoft documentation says the Directory class exposes static methods for creating, moving, and enumerating through directories and subdirectories. In addition, you may access and manipulate various directory attributes such as creation or last modified time stamps, along...
The .NET Framework has built-in support for globalisation in its System.Globalization namespace. This namespace can help you build international support into your applications. If you plan your applications to include support for an international audience, the cost to develop them isn't much...
Generics are the most powerful feature of C# 2.0. Generics allow you to define type-safe data structures, without committing to actual data types. This results in a significant performance boost and higher quality code, because you get to reuse data processing algorithms without duplicating...
1. Take a new C# Dll project 2. Add a new windows console application project to the solution 3. Add the following to the Dll project. namespace BasicRefDll { public class SampleClass { /// <summary> /// Shows the message box /// </summary>
Introduction An event is a message sent by an object to signal the occurrence of an action. The action could be caused by user interaction, such as a mouse click, or it could be triggered by some other program logic. The object that raises the event is called the event sender. The object that...
Introduction LinkedList is a general-purpose linked list. It supports enumerators and implements the ICollection interface.It is a true linked list with separate nodes of type LinkedListNode, so insertion and removal are O(1) operations. Lists that contain reference types perform better if...
Introduction Whenever you generate a new C# Windows Application using the .NET IDE you have the following lines in the main of your program in program.cs file. Did you ever try to note what are these and what do they do. If not I will explain to you the meaning of each line. ...
Introduction XML, or Extensible Markup Language, is a very popular format used to store and share data. In a nutshell, XML stores information in a tree-based text format that allows both you and I as well as computers to easily read the data. I'm sure you have used XML-like languages directly or...
Introduction Classe Will be used to implement most objects. Somtimes however, it may be desirable to create an object that behavves like one of the references. in that case, a value type used, wich is done by declaring a Struct in C#. structs act similarly to classes, but with a few added...
Introduction Iteration Statements are often known as looping, and they run many times while specific condition is true. I would try to explain some of them here. The lesson is for a begginer, and I guess that everyone need to know them. While The While loop function used and while the...
Introduction Classes and structs can be restricted so that only the program or namespace they are declared in may use them. Class members can be restricted so that only derived classes can use them, or restricted so that only classes within the current namespace or program can use them. Access...
System.Windows.Forms.Timer 1. It's a forms-based timer. 2. After creating it, you can set the interval which elapses between ticks using the Interval and hook up a delegate to its Tick event. 3. Calling Start and Stop methods, start and stop of the timer. 4. It runs entirely on the...
In my old MFC programming days we used to track the problems using the OutputDebugString and I have written my own version of OutputDebugString which accepts multiple arguments. When I started C# and .NET I wanted to know how can I do this in C sharp as well and remember that it should be as simple...