Solved

Access folder as a different user

Posted on 2011-02-11
5
748 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:RTSol
  • 2
  • 2
5 Comments
 
LVL 38

Expert Comment

by:younghv
ID: 34870357
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
 
LVL 38

Expert Comment

by:younghv
ID: 34870369
0
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
ID: 34870573
0
 

Author Closing Comment

by:RTSol
ID: 34870644
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
 

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now