C# Programming Tutorials

C Sharp Programming Tutorials And Articles
  Title / Author Replies
Views
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...
3
15,443
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...
5
8,465
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...
3
18,019
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...
0
9,562
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...
0
5,834
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...
0
8,478
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...
0
10,929
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>
0
8,732
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...
0
6,489
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...
0
48,244
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. ...
4
7,752
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...
0
29,052
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...
0
2,925
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...
4
4,805
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...
0
30,547
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...
0
14,643
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...
0
29,378
Background In C#, programmer has no control on when the destructor is going to be executed because this is determined by the Garbage Collector. The garbage collector checks for objects that are no longer used by the application and calls the destructors of all the objects and reclaims the memory...
0
5,006
Background As in other langauges When you derive a class from a base class, the derived class will inherit all members of the base class except constructors, though whether the derived class would be able to access those members would depend upon the accessibility of those members in the base...
0
3,881
Introduction Sometimes you have data with a 1:1 relationship between the key and values and you need to put them into a Hashtable for easy retrieval and later realize you need to look up the keys from the values in the table. I came across such a problem for a combo box item displayed and actual...
0
4,062