My new favorite macro in Visual Studio 2008 is control-D then control-K. Hit that key sequence and voila: all code on the page has been formatted. It’s especially helpful when copy-pasting. Just a tip from Tim to make your life easier!
Continue reading about Auto Format Code in Visual Studio 2008
The IsNullOrEmpty method was added to the String class in the 2.0 Framework, and it makes testing for an empty or null string as easy as a single function call. Instead of having to test the String object if it’s null then checking if it’s empty, this can now be done in one easy method [...]
Cross site scripting can be a tough vulnerability to eliminate, but it doesn’t necessarily have to be. If you’re working on an ASP.NET project, the Microsoft Anti-XSS library is easy to use and freely available. Like a lot of developers, I’ve rolled my own anti-XSS by escaping specific characters, but it’s usually clunky and let’s [...]
Continue reading about Getting Serious About Security – Part 2 – XSS
I recently completed a project at work that included the requirement to monitor data files on 30 or more different Windows NT4 machines for changes. Naturally I thought of using the FileSystemWatcher class in the System.IO namespace. As anyone who has used the FileSystemWatcher has come to realize, it can be unreliable. Specifically, if one [...]
In part one of my series on scripting iTunes using C# I showed you how to remove dead tracks from your iTunes library. Now let’s take it one step further and get rid of all those duplicate tracks you might have. For my purposes, I determined a duplicate track to be any track that has the same artist, [...]
If you’re like me you’ve got thousands of songs in your iTunes library. I got a new notebook PC a couple months back, and I decided to move all my music to it since it’s got plenty of disk space. I know I had lots of songs in my library whose files didn’t exist anymore. [...]