P
Pete Kane
Hello all, how can I check for multiple file attributes using bitwise
operators ? I'm thinking along the lines of
string fname = "c:\\test.txt";
if(File.GetAttributes(fname) & (FileAttributes.ReadOnly |
FileAttributes.Archive ))
{
File.SetAttributes(fname,FileAttributes.Normal);
}
Basically I'm trying to say "If Readonly or Archive" then set the attribute
to normal, as you can tell I'm new to C#
operators ? I'm thinking along the lines of
string fname = "c:\\test.txt";
if(File.GetAttributes(fname) & (FileAttributes.ReadOnly |
FileAttributes.Archive ))
{
File.SetAttributes(fname,FileAttributes.Normal);
}
Basically I'm trying to say "If Readonly or Archive" then set the attribute
to normal, as you can tell I'm new to C#