In C # provides the file and the FileInfo class, these two classes of methods are basically the same, previously only know to use, has not figured out what is the difference, reading today a little unexpected harvest, and partners to share:
Both file and FileInfo provide action on files
The file class provides a static method, the file class cannot be inherited, nor does it produce an instance, and it is more efficient to use the file class than to use FileInfo, if it is only needed once or infrequently, but the file class spends time on the method for security checks. The FileInfo is only a check when the instance is produced, and will not be checked later, so if you need to repeatedly manipulate the file, using FileInfo will be more efficient than using file.
The same goes for the same directory as DirectoryInfo.
FileSystemInfo provides a common way for FileInfo and DirectoryInfo to operate on files or directories, and it is convenient to use FileSystemInfo when the object of the uncertainty operation is a file or directory.
The above is my understanding, if there is not the right place, please correct me and learn from each other.