Link to home
Start Free TrialLog in
Avatar of RTSol
RTSol

asked on

Access folder as a different user

Hi,

I have the following situation: I have a WPF application written in C#. In the application I need to access a folder on the network. This foder has the appropriate rights only for a special user. How can I, in my application, access files in this folder with the privileges of this special user?

Best regards
RTSol
Avatar of younghv
younghv
Flag of United States of America image

You (an Admin, or the 'owner' of that folder) simply need to right-click on the folder and modify the 'permissions'.

Are you familar with the process?
ASKER CERTIFIED SOLUTION
Avatar of Praveen Kumar
Praveen Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RTSol
RTSol

ASKER

Impersonation was the trick. I searched a bit more and I aslo found this post: http://www.freshclickmedia.com/blog/2008/11/programmatic-impersonation-in-c/

This code worked right out of the box.

Thanks a lot for the trigger
RTSol
Avatar of RTSol

ASKER

PS. younghv - The idea was to not change the permissions so the user can go there outside my app and mess things up.