Wednesday, October 28, 2015

How to create threads in C# ?

Threads can be created like other objects in C# using the 'new' keyword.
Thread th = new Thread(Write);
Thread class is available in System.Threading namespace.
We can start a thread using Start() method like.
th.Start();

Sunday, October 11, 2015

What are threads (multi-threading) in C# ?

Threads are the independent units of execution and can run simultaneously with other threads. Threads helps in achieving parallel execution in C#, which is also called multithreading.
A C# program typically starts with a single thread create automatically by CLR (Common Language Runtime) and operating system. If needed, additional threads has to be created manually through code.

Saturday, October 10, 2015

How to measure execution speed (time) in Milliseconds, Microseconds and Nanoseconds using Stopwatch in C# ?

There are situations in the programming world where developers need to measure the execution time of the code.
.NET framework provides Stopwatch class to measure elapsed time for an interval which has two properties ElapsedMilliseconds and ElapsedTicks.

Sunday, October 4, 2015

What is difference between DateTime.Now and DateTime.UtcNow ?

DateTime.Now is a built in property provided by .NET framework which returns the current time of the machine which is executing the code.
This property internally converts the DateTime.UtcNow provided value to the date and time format of the machine executing the code. Hence this property has an overhead of execution, so must be used carefully.

Sunday, September 20, 2015

What is IL (Intermediate Language) in .Net framework ?

Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.

Wednesday, June 3, 2015

History of .Net framework

.NET Framework Version 1.0 
The first version of the .NET Framework was released on 13 February 2002 for Windows 98, ME, NT 4.0, 2000, and XP.
.NET Framework Version 1.1 
Version 1.1 is the first major .NET Framework upgrade. It is available on its own as a redistributable package or in a software development kit, and was published on 3 April 2003.

What is .Net Framework ?

.NET Framework is a complete environment that allows developers to develop, run, and deploy the following applications:
  • Console applications
  • Windows Forms applications
  • Windows Presentation Foundation (WPF) applications

Sunday, May 3, 2015

What are Classes in C# ?

Classes are the blueprints for objects. Everything in C# is based upon classes.
A class normally consists of Methods, Fields and Properties. Classes are declared by using the keyword "class" followed by the class name and a set of class members surrounded by curly braces.

What is Object-Oriented Programming ?

Object-oriented programming (OOP) is a programming language model organized around "OBJECTS" instead of "actions" and data rather than logic. In procedural programming language, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.

Saturday, May 2, 2015

What is C# programming language ?

C# (pronounced as "see sharp") is an object-oriented programming (OOP) language created by Microsoft team which is led by Anders Hejlsberg. It is part of .Net family from Microsoft. C# is a language derived from C and C++, including features which made the language easy to use.