Is There a better way to do this.
FileInfo f = new FileInfo("C://notebook.txt");
public bool Archived
{
get
{
return (((File.GetAttributes(f.FullName)) & FileAttributes.Archive) == FileAttributes.Archive);
}
set
{
if (value == true)
{
if (!this.Archived)
{
File.SetAttributes(f.FullName, File.GetAttributes(f.FullName) | FileAttributes.Archive);
}
}
else if (value == false)
{
if (this.Archived)
{
File.SetAttributes(f.FullName, File.GetAttributes(f.FullName) & ~FileAttributes.Archive);
}
}
}
}
`