Solved

Access folder as a different user

Posted on 2011-02-11
5
747 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
Comment Utility
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
Comment Utility
0
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:RTSol
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
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…

763 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

10 Experts available now in Live!

Get 1:1 Help Now