FileInfo."Dispose"

All over my code i have things like
dim fi as new system.io.fileinfo(fn)

My mommy doesn't work here, so I clean up after myself.

Fileinfo does not offer a dispose method. What is the appropriate thing to do when you are done with it? fi = Nothing, perhaps? ?

Any problem with creating fileinfo's at the drop of a hat? Or should a single one be created and used for everything, as I used to do with FileSystemObject in the vb6 days?

Regards,
Al

[463 byte] By [AlChristoph] at [2007-12-16]
# 1

You can just let FileInfo objects go out of scope and the garbage collector (or your mommy) cleans up after you.

Depends on how many FileInfo objects you are going to create and how often.

DavidM.Kean at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified