The most important point that one should keep in mind when
working with files and directories in .NET is the necessary permissions that are
required for the user. It should be noted that the static methods of the File
and the Directory classes require a security check for them to operate; this
hampers the performance a bit. I would recommend using the FileInfo and the
DirectoryInfo classes over the File and the DirectoryInfo classes if you have a
lot of operations to perform on the files and the directories in your file
system.