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
RTSolAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
younghvCommented:
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?
0
 
younghvCommented:
0
 
RTSolAuthor Commented:
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
0
 
RTSolAuthor Commented:
PS. younghv - The idea was to not change the permissions so the user can go there outside my app and mess things up.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.