Code Vault

Access Windows special directories (My document, Desktop, Program Files)

October 12, 2009 - No Comments - C#.NET Code

You can easily access to special directories of windows in C# by using:

Environment.SpecialFolder.MyDocuments;

The same go with other directories

Environment.SpecialFolder.Desktop;
Environment.SpecialFolder.History;

Article Tags: ,

A shorter way for If statement in C#

July 17, 2009 - 3 Comments - C#.NET Code

Instead of writing:

if (idx == 1)
{
result = “Yes”;
}
else
[...]

Article

Delete query using Subsonic

May 14, 2009 - No Comments - C#.NET Code

Here’s a quick little bit of code that shows how to delete records in your database using SubSonic’s Query Tool. I know you can write this is fewer lines of code, but I think this shows a little more clearly what’s going on.

Article

Recent posts from specific category

April 24, 2009 - No Comments - Wordpress Code

Show a recent posts from a specific category in wordpress.

Article

Get directory size

April 22, 2009 - No Comments - C#.NET Code

Using trace back to get the size of a specific directory.

Article