What exactly is a temporary file? Put simply, a temporary file is a file used by an application for storing temporary data. There is no fixed rule which specifies what this data should be, but generally temporary files (or temp files) are used for storing ‘work data‘. For example Microsoft Office uses temp files to [...]
In this article I am going to show you how to monitor a folder for changes. A reason why you might want to do this is for example if you want to keep two files in different locations in sync. When the original file is changed it would trigger an event and you can update [...]
In this post I am going to show you a few different ways how you can format a decimal number (float, double, or decimal). Setting the Maximum Allowed Decimal Places To format your numbers to a maximum of two decimal places use the format string {0:0.##} as shown in the below example: string.Format(“{0:0.##}”, 256.583); // [...]
In this post I am going to show you a few different ways how you can format an integer (int). Padding with Zeroes To pad your integer with zeroes write your format string with a colon (‘:’) and include as many zeroes as you wish after the colon ({0:[your zeroes]}). Below are a few examples. [...]
In this post I have listed the different formatting options provided by .NET for a DateTime object. The examples shown below are based on the following DateTime object: // 18 September 2009 20:10:35 DateTime dt = new DateTime(2009, 09, 18, 20, 10, 35, 123); Format specifier Description Result dt.ToString(); To String 18/09/2009 20:10:35 dt.ToString(“d”); dt.ToShortDateString(); [...]