OdedCoster.com/blog

One day I will think of something clever to put here

Browsing Posts in Programming

In the Microsoft.VisualBasic.FileIO (Microsoft.VisualBasic.dll) namespace lives the TextFieldParser class. This useful little class can be used to parse structured text files – either delimited or fixed length. You can iterate over the lines in the file and extract the data through the ReadFields method. Since it is provided by Microsoft, you can use it in [...]

Why is that? If one takes the time to think about it, class libraries only ever execute in the context of an application – a web application, a console application, a unit test runner or some other executable. A class library gets loaded into the memory space of the application and gets called and executed [...]

One of the most common misunderstandings I see on StackOverflow regarding the DateTime structure is the difference between the value of a DateTime instance and how it is displayed. A DateTime instance (say one representing midnight of March 26th 2011) has an internal representation that has no specific formatting – it is not something that [...]

When formatting a currency for display, always use a CultureInfo object when outputting in order to get the correct formatting – different places will have a different thousands separator, decimal separator and more. In many cases, you can get the CultureInfo from the UI thread and in a web application you could guess which one [...]