Get file attributes in CSharp
Description
The following code shows how to get file attributes.
Example
//from w ww . jav a 2 s .c om
using System;
using System.IO;
public class MainClass
{
public static int Main(string[] args)
{
FileInfo f = new FileInfo(@"C:\Test.txt");
FileStream fs = f.Create();
Console.WriteLine("Full name: {0}", f.FullName);
Console.WriteLine("Full atts: {0}", f.Attributes.ToString());
fs.Close();
f.Delete();
return 0;
}
}