FileAttribute 枚举

定义

指示当调用文件访问函数时要使用的文件特性。Indicates the file attributes to use when calling file-access functions.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class FileAttribute
[System.Flags]
public enum FileAttribute
type FileAttribute = 
Public Enum FileAttribute
继承
FileAttribute
属性

字段

Archive 32

文件自上次备份后已更改。File has changed since last backup. 此成员等效于 Visual Basic 常量 vbArchiveThis member is equivalent to the Visual Basic constant vbArchive.

Directory 16

目录或文件夹。Directory or folder. 此成员等效于 Visual Basic 常量 vbDirectoryThis member is equivalent to the Visual Basic constant vbDirectory.

Hidden 2

隐藏。Hidden. 此成员等效于 Visual Basic 常量 vbHiddenThis member is equivalent to the Visual Basic constant vbHidden.

Normal 0

正常(DirSetAttr 的默认值)。Normal (default for Dir and SetAttr). 对此文件未应用特殊特征。No special characteristics apply to this file. 此成员等效于 Visual Basic 常量 vbNormalThis member is equivalent to the Visual Basic constant vbNormal.

ReadOnly 1

只读。Read only. 此成员等效于 Visual Basic 常量 vbReadOnlyThis member is equivalent to the Visual Basic constant vbReadOnly.

System 4

系统文件。System file. 此成员等效于 Visual Basic 常量 vbSystemThis member is equivalent to the Visual Basic constant vbSystem.

Volume 8

卷标。Volume label. SetAttr 一起使用时此特性无效。This attribute is not valid when used with SetAttr. 此成员等效于 Visual Basic 常量 vbVolumeThis member is equivalent to the Visual Basic constant vbVolume.

注解

调用DirGetAttrFileAttribute函数时, 可以在代码中使用枚举来替换实际值。 SetAttrWhen you call the Dir, GetAttr, or SetAttr functions, you can use the FileAttribute enumeration in your code in place of the actual values.

Attributes 参数FileAttribute采用枚举成员。The Attributes argument takes the FileAttribute enumeration members.

执行文件 i/o 操作时, My.Computer.FileSystem对象可提供比旧的文件 i/o 方法更好的性能和易用性。When performing file I/O operations, the My.Computer.FileSystem object provides greater performance and ease of use than legacy file I/O methods. 有关更多信息,请参见FileSystemFor more information, see FileSystem .

适用于

另请参阅