There is a good description of .RESX files here: Resources in .Resx File Format[^] which explains the file format (XML) as well as touching on what it holds.
Basically, it's a human-and-machine readable file which holds the images, icons, text (including - but not restricted to - localisation strings), sounds, and other resources that your app needs to have compiled into it that the compiler uses to build your final EXE or DLL assembly.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Your application will be running as the user that launched it. Your code cannot give more permissions than it already has from the user running it. Also, any changes to NTFS permissions are done as the user running your code. There is NOTHING preventing the user from just putting the permissions back that your code took away.
Permissions are just about never set in application code at run time but set at install time.
Your application can talk to a service that's running as an account that has sufficient permissions to set/remove permissions on folders.
This is a management nightmare, requiring a good working knowledge of how permissions work and are inherited in the NTFS tree. Such an explanation is beyond the capacity of forums posts.
Now, there's another way. Screw all the management of granting and taking permissions. The service would be the "file manager" in a folder where only the service account has permissions to write files/create folders. Your application could ask the service to save files/create folders as appropriate and the service would do all the file/folder work on behalf of the application using the permissions granted to it by it's own user account. This user account has to be specially setup to login as a service and has the appropriate permissions to where the files/folder will be stored.
You are effectively asking how to keep something private on a machine that ain't yours. You could 'hijack' the data, encrypt everything and keep your encryptionkey on a server. Not a good way to formulate it, but the question here is ownership. If you don't want them to access a file, then don't have it on the local machine.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
Open the file in your app, and do not close it while the application is running. Make sure you set FileShare.None when opening the file. Of course, when you close your app, Windows will close the file, and now the user can access it.
Last Visit: 31-Dec-99 19:00 Last Update: 8-Dec-23 13:00