Search code examples
c#file-iofileinfo

File.Delete() versus FileInfo.Delete()


Is there much of a difference between using the static methods of the File object as opposed to creating a new FileInfo object and calling those methods?


Solution

  • The only difference is that File must resolve the specified path (assuming it is relative), while the FileInfo should have already have the resolved path.