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

SetAttributesInternal() private static méthode

private static SetAttributesInternal ( string fullPath, FileAttributes attributes ) : void
fullPath string
attributes FileAttributes
Résultat void
        private static void SetAttributesInternal(string fullPath, FileAttributes attributes)
        {
            bool r = Interop.Kernel32.SetFileAttributes(fullPath, (int)attributes);
            if (!r)
            {
                int errorCode = Marshal.GetLastWin32Error();
                if (errorCode == Interop.Errors.ERROR_INVALID_PARAMETER)
                    throw new ArgumentException(SR.Arg_InvalidFileAttrs, nameof(attributes));
                throw Win32Marshal.GetExceptionForWin32Error(errorCode, fullPath);
            }
        }