Dot Net

Sorting Arrays [C#]

15/12/2011 15:01
  Sorting Arrays [C#] This example shows how to sort arrays in C#. Array can be sorted using static method Array.Sort which internally use Quicksort algorithm. Sorting array of primitive types To sort array of primitive types such as int, double or string use method Array.Sort(Array)...

Start, Stop and Restart Windows Service [C#]

15/12/2011 14:56
  Start, Stop and Restart Windows Service [C#] This example shows how to start, stop and restart a windows service programmatically in C#. Start service The following method tries to start a service specified by a service name. Then it waits until the service is running or a...

Create New Thread [C#]

15/12/2011 14:52
  Create New Thread [C#] This example shows how to create a new thread in .NET Framework. First, create a new ThreadStart delegate. The delegate points to a method that will be executed by the new thread. Pass this delegate as a parameter when creating a new Thread instance. Finally,...

Cancel an Asynchronous Method [C#]

15/12/2011 14:50
  Cancel an Asynchronous Method [C#] This example shows how to implement support for asynchronous method cancellation in your class. It is based on the Create an Asynchronous Method example. This example is part of asynchronous method implementation series. We implement a CancelAsync...

Asynchronous Method Progress Reporting [C#]

15/12/2011 14:46
  Asynchronous Method Progress Reporting [C#] This example demonstrates how to report progress information and intermediate results from an asynchronous method. It builds on a previous example, Create an Asynchronous Method. This example is part of asynchronous method implementation...

Create an Asynchronous Method [C#]

15/12/2011 14:45
  Create an Asynchronous Method [C#] This example shows how to create an asynchronous method conforming to the Event-based Asynchronous pattern. This example is part of asynchronous method implementation series. In this example, we create an asynchronous version of a method that...

Reflection Examples [C#]

15/12/2011 14:43
  Reflection Examples [C#] This example shows how to dynamically load assembly, how to create object instance, how to invoke method or how to get and set property value. Create instance from assembly that is in your project References The following examples create instances of...

Catching Unhandled Exceptions [C#]

15/12/2011 14:41
  Catching Unhandled Exceptions [C#] This example shows how to manage all exceptions that haven't been caught in the try-catch sections (in Windows Forms application). The UnhandledException event handles uncaught exceptions thrown from the main UI thread. The ThreadException event...

Custom DateTime Format

15/12/2011 14:36
Custom DateTime Format: DateTime thisDate1 = new DateTime(2011, 6, 10); Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + "."); DateTimeOffset thisDate2 = new DateTimeOffset(2011, 6, 10, 15, 24, 16, ...

Culture Names [C#]

15/12/2011 14:24
  Culture Names [C#] This example shows how to get all culture names in the .NET Framework. Use static method CultureInfo.Get­Cultures. To get associated specific culture use static method CultureInfo.Cre­ateSpecificCul­ture. Following code is modified MSDN example (it's just...
<< 1 | 2 | 3 | 4 | 5 >>