System.IO.Win32FileSystem.FileExists C# (CSharp) Méthode

FileExists() public méthode

public FileExists ( System fullPath ) : bool
fullPath System
Résultat bool
        public override bool FileExists(System.String fullPath)
        {
            Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data = new Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA();
            int errorCode = FillAttributeInfo(fullPath, ref data, false, true);

            return (errorCode == 0) && (data.fileAttributes != -1)
                    && ((data.fileAttributes & Interop.Kernel32.FileAttributes.FILE_ATTRIBUTE_DIRECTORY) == 0);
        }