Example Codes

My .Net Blog — posts in this category.

Example Codes

Timer in WPF

In Windows Form time, there is a component for Timer. But in WPF, there is not such things. So, what thing we can do, when we need to execute a piece of code…

Read more
Example Codes

WPF Example Code - AdvGenStopWatch

I created an opensource project, AdvGenStopWatch. This is a simple stop watch program and aimed to show how to use WPF. Including the following features: - How…

Read more
Example Codes

Windows Service Tutorial 1

This tutorial is to build a simple Windows Services. 1. Create a Windows Service Project, File->New->Project 2. Please add these codes into Services1.cs…

Read more
Example Codes

Mutex Lock Example

I have written an example project in C#. This example will shows how to use Mutex Lock. Moreover, it will demonstrate how to create a thread with parameters.…

Read more
Example Codes

Getting Row Count in NHibernate

Getting the row count of a table, that is easy in NHibernate. You can do it this way: ICriteria criteria = CurrentSession.CreateCriteria<Member>();…

Read more
Example Codes

C# codes examples

I found the best way to learn a programming is reading example codes. So, I found this website,Microsoft All-In-One Code Framework, is very useful. Roughly, it…

Read more
Example Codes

Set the icon of a window in WPF

Setting the Icon of a window in WPF is very simple! In your window xaml, you need to put the filename of your icon file in icon attribute, like the following:…

Read more
Example Codes

Write a wav file player in C#

That is a bit hard to write a mp3 player in C#. I think you may need to find third party mp3 decoder dll. But if you only want to play to a wav file, that is…

Read more