Accessing files/directories with different permission  
Author Message
asadim





PostPosted: Visual C# General, Accessing files/directories with different permission Top

I try to access the files in a certain folder using Directory.GetFiles() and a bunch of permission denials are thrown back at me. How can I let the program access the folder using a certain user/permission set Thanks.

Visual C#7  
 
 
Figo Fei - MSFT





PostPosted: Visual C# General, Accessing files/directories with different permission Top

Hi,

Only if you are in administrator role of the windows, it allow you to modify others' role (even to admin).

So, just set the security setting of the file or folder to the specific user or group.

Thank you



 
 
frederikm





PostPosted: Visual C# General, Accessing files/directories with different permission Top

Hi

if you can't modify the settings on the files,

you could try to get the files and process them under the identity of an administrator

check out impersonation:

http://www.codeproject.com/csharp/cpimpersonation1.asp

Hope this helps you out, please close the thread if it does