Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool UpdateResFile(string fileName, string language, string objectName, string NewValue)
- {
- FileInfo fi = new FileInfo(fileName);
- try
- {
- //Do Stuff
- xDoc.Save(fileToUpdate);
- }
- catch (UnauthorizedAccessException)
- {
- //fi.IsReadOnly = false;
- File.SetAttributes(fileName, FileAttributes.Normal);
- //fi.Attributes -= FileAttributes.ReadOnly;
- return UpdateResFile(fileName, language, objectName, NewValue);
- }
- catch (System.Exception ex)
- {
- Console.WriteLine(ex.Message);
- return false;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment