I need to grant all users full read/write access to some files. The
files are created by a Windows administrator.
The following code sample grants all users full read/write access to
the file myFile.
The code is executed at file creation time (a Windows administrator
does this file creation)
Unfourtunatley the code below only works for dotnet 2.0
I need something like the following, but for dotnet 1.
FileSecurity fileSecurity = File.GetAccessControl(myFile);
fileSecurity.AddAccessRule(
new FileSystemAccessRule(
System.Security.Principal.WindowsIdentity.GetCurre nt().Name,
FileSystemRights.FullControl,
AccessControlType.Allow)
);
File.SetAccessControl(myFile, fileSecurity);
Does anyone know a way?