How do i change a file from read-only to normal?
i tried the folowwing
FileInfo fi2 = new FileInfo(@"\files\demo\notes.txt");
fi2.Attributes = fi2.Attributes | FileAttributes.ReadOnly;
But it doesn't work :(
--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net
"Lisa" <j__i...@hotmail.com> wrote in message
news:OS7QSnDw...@TK2MSFTNGP09.phx.gbl...
Try the following:
FileInfo fi = new FileInfo(fileLocation);
if((FileAttributes.ReadOnly) == (fi.Attributes &
FileAttributes.ReadOnly)) // bitwise comparison
{
fi.Attributes -= FileAttributes.ReadOnly; // remove the readonly
attribute
}
Cheers,
Jon
"Lisa" <j__i...@hotmail.com> wrote in message
news:OS7QSnDw...@TK2MSFTNGP09.phx.gbl...