The AttributeFilter class can be used to filter files and folders according to their attributes. The attributes are specified by using the FileAttributes enumeration.
Process all files that have the read-only attribute.
| C# |
Copy Code |
|---|---|
AbstractFile[] files = myFolder.GetFiles( true, new AttributeFilter( System.IO.FileAttributes.ReadOnly ) ); | |
| VB.NET |
Copy Code |
|---|---|
Dim files As AbstractFile() = myFolder.GetFiles( True, _ New AttributeFilter( System.IO.FileAttributes.ReadOnly ) ) | |
Process all files that have both the read-only and the hidden attribute.
| C# |
Copy Code |
|---|---|
AbstractFile[] files = myFolder.GetFiles( true, new AttributeFilter( System.IO.FileAttributes.ReadOnly ), new AttributeFilter( System.IO.FileAttributes.Hidden ) ); | |
| VB.NET |
Copy Code |
|---|---|
Dim files As AbstractFile() = myFolder.GetFiles( True, _ New AttributeFilter( System.IO.FileAttributes.ReadOnly ), _ New AttributeFilter( System.IO.FileAttributes.Hidden ) ) | |
Process all files that have either the read-only or hidden attribute.
| C# |
Copy Code |
|---|---|
AbstractFile[] files = myFolder.GetFiles( true, new AttributeFilter( System.IO.FileAttributes.ReadOnly|System.IO.FileAttributes.Hidden ) ); | |
| VB.NET |
Copy Code |
|---|---|
Dim files As AbstractFile() = myFolder.GetFiles( True, _ New AttributeFilter( System.IO.FileAttributes.ReadOnly|System.IO.FileAttributes.Hidden ) ) | |
The pipe | character used in the constructor of the AttributeFilter class serves the same purpose as an OrFilter class.