Manish Jain

Manish Jain

  • 1.3k
  • 414
  • 9.3k

How to dispose an object created by FileInfo class

Oct 13 2014 5:03 AM
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)