I can not seem to change the read-only flag on file. I have tried vista and XP with the same result, so I do not think this is an issue related to the UAC.
Whatever I have done, it seems to work. See sample below, does anyone tell me what I am doing?
public hair updateResFile (string filename, string language, string object name, string new value) {FileInfo fi = new FileInfo (fileName); Try {// Do Stuff xDoc.Save (fileToUpdate); } Hold (unauthorized access to access) {//fi.IsReadOnly = false; File .set property (filename, description of file. General); //fi.Attributes - = FileAttributes.ReadOnly; UpdateResFile (Filename, Language, ObjectName, NewValue) Return; } Hold (prior to System.Exception) {Console.WriteLine (ex.Message); return false; } Back true; }
It is not possible to change the read-only attributes of a file on unauthorizedAccessException Executing with the permissions in the computer.
If you do not normally have permission to allow this file to be read, your application will not change this feature too.
Thanks. Josiea
Comments
Post a Comment