GetDirectories UNC path - Acces Denied

F

frederik

Hi

The website have to show subdirectories on a network drive.

I use the following code:

string[] directories;
directories=Directory.GetDirectories(_Path);
....

The _Path contains an url like \\server\directory\subdirectory\
Impersonate is set to true

When i try the code from the localhost, i receive the subdirectories.

When i try the _Path directly in my browser, i see the subdirectories.

I copied the dll to the production server.
When i use this dos command line to check if i have rights to read the
_Path, everything works fine. (runas :user:username cmd)
from this cmd screen i have acces to the _Path

When i try the website, i receive always access denied, even if
impersonate is set to true.
Can someone explain me more about this problem ?

frederik
 
G

Guest

I think the account that you are running IIS and asp.net on production server
don't have access permission to the network path.
 
K

Ken Cox [Microsoft MVP]

Make sure that you are impersonating with an account that is set up on the
remote server rather than trying to pass authentication around from one
domain to another.
 
F

frederik

We cannot change the structure.

I think that the account i'm impersonating with is correct setup
because when i copy the project on my own pc, it's working fine.

Even if i try to contact de folder from the server to the remote
server, i have acces with my account. Only if it's running under a
website i receive accessdenied.

But why with IIS on the server and NOt with IIS on my local pc

frederik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top