Click or drag to resize
GDStorageFileAttributes Property
Gets the attributes of the current file.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public FileAttributes Attributes { get; }

Property Value

Type: FileAttributes
The attributes of the current file.

Implements

IGDStorageItemAttributes
IGDStorageItemAttributes
Exceptions
ExceptionCondition
Exception(C# equivalent: System.IO.FileNotFoundException) File could not be found. HResult ERROR_FILE_NOT_FOUND.
Examples
The following example shows how to check the attributes of a file.
using Windows.Storage;
using System.Diagnostics; // For writing results to the Output window.
using GD;

// Get the GD root file
var appFIle = await GDWindows.Instance.SecureFolder.CreateFileAsync("foo.bar");

// Get the file's attributes.
FileAttributes fileAttributes = appFIle.Attributes;

// Check the file's attributes.
// Write the results to the Visual Studio Output window.
if ((fileAttributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
    Debug.WriteLine("The item is read-only.");
if ((fileAttributes & FileAttributes.Directory) == FileAttributes.Directory)
    Debug.WriteLine("The item is a file.");
if ((fileAttributes & FileAttributes.Archive) == FileAttributes.Archive)
    Debug.WriteLine("The item is archived.");
if ((fileAttributes & FileAttributes.Temporary) == FileAttributes.Temporary)
    Debug.WriteLine("The item is temporary.");
See Also