示例#1
0
        /// <summary>
        /// Checks whether the specified file exists.
        /// </summary>
        /// <param name="path">The path to check.</param>
        /// <returns><b>true</b> if the caller has the required permissions and path contains the name of an existing file; otherwise, <b>false</b></returns>
        /// <remarks>The original Exists method returns also false on null! http://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).aspx</remarks>
        /// <exception cref="UnmatchedFileSystemEntryTypeException">Searched for file but found folder.</exception>
        /// <exception cref="InvalidPathException">Path is invalid.</exception>
        public static bool Exists(string path)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(path));

            return(InternalQuickIO.FileExists(path));
        }