SetAttributes(Path: String; Attributes: FileAttributes);
Path - a directory attributes of which should be changed.
Attributes - attributes that should be set. It is recommended to use values of a enumerable type FileAttributes to set attributes. Values in a list are separated with the logical operation Or.
The SetAttributes method sets specified attributes for a directory, specified in the Path parameter.
Sub UserProc(sPath: String);
Begin
If Directory.Exists(sPath) Then
Directory.SetAttributes(sPath,
FileAttributes.ReadOnly Or FileAttributes.Hidden);
End If;
End Sub UserProc;
While executing this example it is checked whether directory, specified in the parameter sPath, is present in file system. If a directory exists, attributes Read Only and Hidden are assigned to it.
See also: