For some reason, Microsoft didn’t add a Week property to the DateTime class. I never could figure out why. Instead they gave us the System.Globalization namespace, filled with date related functionality like the...
Today, I had to implement custom performance counters in one of our applications. I haven’t worked much with performance counters before, so I wanted to check the Internet for some good articles and maybe some helper...
Sometimes you just want a simple function to perform a simple task. There are a lot of FTP libraries for free download on the Internet, but if you simply want to upload a file to an FTP server in C#, these libraries are...
I recently needed to validate a GUID in C# and found this article on how to do it. I've simplified it to make it suit the problem I was trying to solve. Here's what I did with it: private static Regex isGuid = new Regex(...
A colleague and I had a discussion the other day about the use of curly brackets in C# and when to use them. The use of curly brackets is of course a part of the C# syntax, but you can use them in various different ways...
Today, I had to do file renaming on 1.000 files in a directory so they could be sorted alphabetically. I will not go into details, but it was a lot trickier than anticipated because the original filenames where very...
Working with strings is something all developers do all the time. It’s probably the thing we spend more time with above anything else. In C# 2.0 many new features for string manipulation has been added, so I’ll dig into...
Isolated Storage is a place in Windows where .NET is grated read/write permissions by default. It is a physical folder like any other folder and is located somewhere within C:\Documents and Settings\User name\Local...
Last week, Rocky Lhotka returned to the .NET Rocks! online radio show with Carl Franklin , announcing the release of his CSLA.NET 2.0 business object framework. This is exciting news for anyone who uses the framework...
If you use FxCop , then you are probably also aware of this rule . Exceptions should only be catched if they can be handled. A lot of exception handling code I’ve seen, are handling exceptions that could easily be...