Having a mental block today, need a hand verifying my logic isn\'t fubar\'ed.
Traditionally I would do file i/o similar to this:
FileStream fs = null
Don't worry, it will clean up as expected and is cleaner than your original.
In fact it's much more common to have a try/finally aka using statement in your business logic, and a try/catch in a top-level handler in the UI tier or at a physical tier boundary. Something like:
try
{
DoStuffWithFile("foo.txt");
}
catch(Exception ex)
{
...
}
and
public void DoStuffWithFile(string fileName)
{
using(FileStream fs = File.Open(fileName,...))
{
// Do Stuff
}
}