I am getting a IO Exception when I disconnect a USB drive from my win
ce board. My code is in VB.NET and the error code is 0x80001009 and it
comes from mscorlib.dll!System.IO.__Error.WinIOError . I have a timer
that writes to this file over and over but when the USB is
disconnected, my exception that I get
is caught with System.IO.IOException and I execute my cleaning up of
the Streamwriter by setting the instance to nothing. then when I step
to the end of the timer function, another disassembled IOException
happens when the function starts to pop off the stack. Any ideas? I am
trying to catch every IO exception in the following order:

Catch ex As System.IO.DirectoryNotFoundException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As System.io.EndOfStreamException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As System.io.FileNotFoundException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As System.io.IOException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As System.io.PathTooLongException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As UnauthorizedAccessException
mODLFileOpen = False
lblODLFileName.Text = ""
mODLFile = Nothing
Catch ex As Exception
MsgBox("Exception7 = " & ex.GetType().ToString & " " &
ex.Message)
mODLFileOpen = False
lblODLFileName.Text = ""
End Try


PLease help me!

Thanks,
Mike Dixon