Snippet IT IT News, Programming, Internet and Blogging

18Apr/090

C#: Unix Time to .Net DateTime and Vice Versa

For some reasons, some programmer might store time values as Unix timestamp in database instead of standard SQL DateTime data type. The main reason to store time values as Unix timestamp is unknown but what I guess is for maximum database compatibility. Some old database does not support SQL DateTime data type.

7Feb/092

C# – Loop all files in directory and it’s sub-directories

Recently I need to write some code to read all files in a directory and it's sub-directories. There are simple way and difficult way (Not very difficult actually). The simple way will be writing a function that reads all files in the directory and call the function again recursively for each sub-directory in that directory.