Config File: Read Only
-
I have multiple *.config files that I need to write to but (somehow) they have all been set to ‘read only’. Can anybody tell me how, in my code, I can uncheck the read only option before attempting to write to the file? Thanks Brad
-
I have multiple *.config files that I need to write to but (somehow) they have all been set to ‘read only’. Can anybody tell me how, in my code, I can uncheck the read only option before attempting to write to the file? Thanks Brad
Brad Fackrell wrote: uncheck the read only option before attempting to write to the file? System.IO.File.SetAttributes("c:\test.txt", IO.FileAttributes.Normal)
-
I have multiple *.config files that I need to write to but (somehow) they have all been set to ‘read only’. Can anybody tell me how, in my code, I can uncheck the read only option before attempting to write to the file? Thanks Brad
You're looking for the FileInfo[^] class and it's GetAttributes and Set Attributes methods. It's nice that you put this functionality into the app, but there are also cases when the suer WANTS the config files read only. It would be better if you added an option to turn this functionality on/off. It would also be better if you figured out why your development copy is ReadOnly in the first place. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
You're looking for the FileInfo[^] class and it's GetAttributes and Set Attributes methods. It's nice that you put this functionality into the app, but there are also cases when the suer WANTS the config files read only. It would be better if you added an option to turn this functionality on/off. It would also be better if you figured out why your development copy is ReadOnly in the first place. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks Dave. I like the idea of being able to turn it on and off. As for why it was read only, I have no idea what happened but I do know that is should NOT be read only and everybody was yelling at me to ‘just do something’. So, for now, I will just force it back to normal. Brad