Archives for: "January 2012"
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 Codeprotected override void OnStart(string[] args){ EventLog.WriteEntry("Example… more »
Commons Library in C#
In the Java World, we have a set of library, Commons, from Apache. They provide a lot of cores functions such as email, logging and validations. In our .Net World, the open source community build a set of Commons Library. They provide a lot of cores… more »
"Invalid attempt to call Read when reader is closed" in LINQ DataContext
I got a lot of error from a LINQ DataContext, such as "Invalid attempt to call Read when reader is closed" . That is because I was using a singleton for DataContext in a multi-threads. The codes like that: Codeprivate static ExampleDataContext… more »
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. Please click here to download. more »
Please remember to use "System.Timers.Timer" in Windows Service
I am implementing a Windows Service. I did a foolish mistake. I opened the design view of windows service and drag-and-drop the Timer from toolbar. Because I need the windows service to execute some code periodically. I found the timer won't triggered… more »