T
tshad
Can't use FileInfo in using statement?
I have the following statement:
using (FileInfo fInfo = new FileInfo(fromImagePath + "\\" +
(string)dr["originalFileName"]))
and I get the following error:
'System.IO.FileInfo': type used in a using statement must be
implicitly convertible to 'System.IDisposable'
I assume that this means I can't use it in my using statement.
So does this would mean that I need to explicitly close fInfo object:
fInfo.Close()
Or should I just let the garbage collector handle it?
Thanks,
Tom
I have the following statement:
using (FileInfo fInfo = new FileInfo(fromImagePath + "\\" +
(string)dr["originalFileName"]))
and I get the following error:
'System.IO.FileInfo': type used in a using statement must be
implicitly convertible to 'System.IDisposable'
I assume that this means I can't use it in my using statement.
So does this would mean that I need to explicitly close fInfo object:
fInfo.Close()
Or should I just let the garbage collector handle it?
Thanks,
Tom