How to

get file attributes

Published: 25. October 2011 | Updated: 25. October 2011
License: Microsoft Public License (MS-PL)
Categories: File system » Files
Tags: C# Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.IO;

Code

string path = @"C:\Folder\test.txt";

FileAttributes attributes = File.GetAttributes(path);

Console.WriteLine(attributes);
Console Output:
ReadOnly, Archive, Compressed
Send us feedback about this snippet »



Related Snippets: