473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

GetDirectories UNC path - Acces Denied

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

Nov 19 '05 #1
3 3270
I think the account that you are running IIS and asp.net on production server
don't have access permission to the network path.

"frederik" wrote:
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

Nov 19 '05 #2
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.

"frederik" <fr*********@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
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


Nov 19 '05 #3
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

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Theerachet Pratoommanee | last post by:
This is error message I've got. Any suggestion would be appreciated. Server Error in '/WebDirectory' Application. ----------------------------------------------------------------------------...
0
by: sven_hub | last post by:
Hello everybody, I read interstings posts by Andy and Willy, but it didn't help regarding my configuration. I try to make a WMI query on a "distant" server, that is actually part of the same...
1
by: Dakkar | last post by:
I'm getting this error when i execute my program ERROR Acces denied for user:'root@DAKKAR123' and when i write the line like this i dont take any error MyConn = new...
2
by: Mike D | last post by:
Can I control the order that files, folders are displayed? Can I do them alphabetically or do I need to upload to a db like we did in asp? items = Directory.GetDirectories(path) For Each item...
3
by: Alejandro Becker | last post by:
Hi, I have Windows 2000 SP4. is domain controller. and Visual studio 2003 I get the error: Access to the path "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET...
0
by: Carl Rapson | last post by:
I have some code that is checking a directory for subdirectories, using the Directory.GetDirectories method (I got this code from a sample app): Dim directories as String() Try directories =...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
0
by: kamig | last post by:
Hi! Scenario: Consuming my webService in a windows application give denied acces! Explanation: I have to say a moveTo fn. which move one file/dir from one drive to another, <authorization>
0
by: mjheitland | last post by:
When I pass my directories recursively on a directory structure with paths 260 chars I get the following exception (see line marked with ***), although I am using only ShortPathNames through...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.