次の方法で共有


File.GetAttributes Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the FileAttributes of the file on the path.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Shared Function GetAttributes ( _
    path As String _
) As FileAttributes
[SecuritySafeCriticalAttribute]
public static FileAttributes GetAttributes(
    string path
)

Parameters

Return Value

Type: System.IO.FileAttributes
The FileAttributes of the file on the path.

Exceptions

Exception Condition
ArgumentException

path is empty, contains only white spaces, or contains invalid characters.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

NotSupportedException

path is in an invalid format.

FileNotFoundException

path represents a file and is invalid, such as being on an unmapped drive, or the file cannot be found.

DirectoryNotFoundException

path represents a directory and is invalid, such as being on an unmapped drive, or the directory cannot be found.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference