Tuesday, March 17, 2009

Windows Explorer - Setting default size and location

Want to set the default size and window location for Windows Explorer on Vista or later?

I've got a new monitor that is larger than my old one. When I would open Windows Explorer the first thing I would always do is resize it to larger size.

I found out you can set the default Explorer size and windows location by simply holding the SHIFT key down when closing the window. Presto!

Sunday, March 8, 2009

Catch (Exception e): Right or wrong?

I've long heard that you shouldn't throw a type Exception in C#. I try to always throw a type derived from Exception.

In addition, I've also read many brief snippets over the years that says you shouldn't write C# code like:

catch(Exception e)
{
...
}

I recently read the best explanation of this in Microsoft's MSDN Magazine (Feb. 2009). The article is entitled Handling Corrupted State Exceptions and would highly recommend those programming in C# to read the full article. It also provides details about how exception handling will change a bit in .NET 4.0.

A read well worth it!

http://msdn.microsoft.com/en-us/magazine/dd419661.aspx

Can't RDP? How to enable / disable virtual machine firewall for Azure VM

Oh no!  I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore.  I did ...