Directory.Exists

  • Thread starter Thread starter Phil Barber
  • Start date Start date
P

Phil Barber

using ASP.NET 1.1

int PID=(int)Session["PID"];
string FilePath=PF.GetProjectPath(PID);
if(!Directory.Exists(FilePath))
Directory.CreateDirectory(FilePath);

the Directory.Exists always returns false even though the Directory does in
fact exist.
note the FilePath string is a UNC path ( @"\\ServerName\..\)
any ideas would be welcome.
the really strange thing is if the directory really does not exist this code
will sucessfully create the directory, so I do not beleive it is a security
issue
Thanks
phil
 
| using ASP.NET 1.1
|
| int PID=(int)Session["PID"];
| string FilePath=PF.GetProjectPath(PID);
| if(!Directory.Exists(FilePath))
| Directory.CreateDirectory(FilePath);
|
| the Directory.Exists always returns false even though the Directory does
in
| fact exist.
| note the FilePath string is a UNC path ( @"\\ServerName\..\)
| any ideas would be welcome.
| the really strange thing is if the directory really does not exist this
code
| will sucessfully create the directory, so I do not beleive it is a
security
| issue
| Thanks
| phil
|
|

That's because you (the asp.net user) don't have any access rights to the
share, note that the default account 'aspnet', doesn't even have network
access rights. So you will have to impersonate a user with appropriate
privileges to access the network share.

Willy.
 

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

Back
Top