C# Programming Tutorials

C Sharp Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
To start with include namespaces using System.Diagnostics; // For prcesss related information using System.Runtime.InteropServices; // For DLL importing Now declare these variables private const int SW_HIDE = 0; Now declare win32 function ShowWindow
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...
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...
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...
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...
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...
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 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...
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...
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 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...
In this article, we are going to explore a couple of fairly advanced C# concepts. We will start by explaining the concept of extension methods in C#. I will explain you with the help of examples, what basically extension methods are, how they are actually used and what its benefits are. Next, we...
C# is a strongly typed language: You might have heard this sentence numerous times. Have you ever wondered, what does that actually mean? We are here with the answer to this question and we would introduce to another fairly advanced and extremely interesting .NET concept, known as dynamic binding....
C# is a language that integrates useful concepts from several programming languages. C# contains advanced features of Java and provided C++’s robustness. The concept of pointer is integral in C and other low level languages. However, C# also allows you to utilize the power of pointers in your code...
.NET framework has everything what it takes to develop a highly customizable software application. Apart from providing thousands of built in classes in language library and common language runtime, .NET offers variety of options during code compilation. Using visual studio you can access those...
Most of the .NET functionalities are provided via managed types. These managed types are organized in hierarchical namespaces. .NET framework contains thousands of types and the number is prospering with every passing day as more and more developers are contributing towards expanding the language...
Strings are an integral part of any programming language. In almost every programming language you would find strings of data being passed as input and being displayed as input. Strings are an important way to interact with the user. Whenever you visit a website, you are often asked to sign up...
Any software application, two of the most frequently done tasks are formatting and parsing the data. In simplest words, formatting refers to the process of converting some type to string and conversely parsing refers to converting string into some other data type. There are several techniques that...
In addition to string, another extremely important entity that lays at the foundation of any software application is the numbers. Numbers play a very crucial role, particularly in the business logic layer of any software application. Logic building requires strong knowledge of numbers and their...
.NET framework provides wide range of namespaces that contain types, interfaces and structs which can be used to store, manage, and sort collections of data. These types include, lists, arrays, linked list and sorted as well as unsorted dictionaries. The types of collections available in .NET...