You shouldn't have to close or dispose of the FileInfo instance you are
using.
1.) Not positive, but I don't think the FileInfo has a lock in place on the
file when it's in use.
2.) FileInfo doesn't implement IDisposable so you can't "Dispose" of it (no
Dispose method to call).
I believe FileInfo is a class holding only data about the file - managed
data - not any unmanaged operating system resources keeping the file
open.
If that is correct then you don't need any Close (or Dispose). Regular
GC will take it when needed.
Arne
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.