Author: Basscyst | Posted on: 11/12/2008 2:56:41 PM | Views : 437

 I have the following code that is impersonating the authenticated user
in IIS (AD login). The folder I'm trying to access is shared and allows
read access for "Everyone". My AD account (The account that is being
impersonated) is also an admin on the machine I'm trying to access, so
it should have write permissions as well. Yet I get an access denied
error when I try to access the files. What might I be able to do to fix
this?





Code:
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
try
{
String[] Files = Directory.GetFiles(@" ...

Go to the complete details ...