Useful .net code that I seem to use over and over again