Let say, a file has the following attributes: ReadOnly, Hidden, Archived, System. How can I remove only one Attribute? (for example ReadOnly)>
ReadOnly, Hidden, Archived, System
string file = "file.txt"; FileAttributes attrs = File.GetAttributes(file); if (attrs.HasFlag(FileAttributes.ReadOnly)) File.SetAttributes(file, attrs & ~FileAttributes.ReadOnly);