I have a server written in C# that makes use of impersonation.
I would like to know how I can change the security attributes of a file so that any user can delete it.
My server impersonates a user and then creates a temporary file. Later on I need to delete the file but at that point, I am no longer impersonating the user that created the file and when an attempt is made to delete the file an exception is generated. My supposition is that at the time I create the file, I should be able to change the security attributes to allow any user to delete the file.
How may I accomplish this (C# preferred but p/invoke will work too).
I am currently using .NET 1.1, so a method that can be implemented in 1.1 would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…