The correct answer is the "using" keyword ensures that any IDisposible objects are properly disposed, even if an exception occurs.
Consider the following:
var f = File.Open("somepath");
f.Write(foo);
throw new Exception();
f.Close();
f.Dispose();
The file stream (a resource shared with other applications and the OS) is never properly closed in this case, which is a bad thing.
However, using the following approach:
using(var f = File.Open("somepath")){
throw new Exception();
}
ensures that the file stream is closed even if an exception occurs inside the block. It is simply a shortcut to writing:
{
FileStream f = File.Open("somepath");
try{
throw new Exception();
}finally{
f.Close();
}
}