I'm getting confused about all this talk about IDispose and "using" Statements. I wonder if someone can tell me if I need to use either a "using" Statement or some sort of implementation of IDispose in the following test example...
public class Main()
{
MyFile myFile = new MyFile("c:\subdir\subdir2\testFile.txt");
Console.Writeline("File Name: " + myFile.FileName() + "File Size: " + myFile.FileSize());
}
public class MyFile
{
private FileInfo _fInfo;
public MyFile(string fullFilePath)
{
_fInfo = new FileInfo(fullFilePath);
}
public string FileName()
{
return _fInfo.Name;
}
public long FileSize()
{
return _fInfo.Length;
}
}