1
Answer

How to dispose an object created by FileInfo class

Photo of Manish Jain

Manish Jain

10y
8.7k
1
I am using a FileInfo class to get the length of the file as follows:
FileInfo infoFile = new FileInfo(configFile);
long configFileLength = infoFile.Length;
 
here configFile is the path of the file.
 
I want to dispose the object infoFile.
How can i do this? 

Answers (1)