471,350 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Directory.Exists

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
Jan 19 '06 #1
1 5369

"Phil Barber" <ph*********@ajg.com> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl...
| 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.

Jan 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Sheldon Cohen | last post: by
4 posts views Thread by Elmo Watson | last post: by
1 post views Thread by Steven J. Reed | last post: by
6 posts views Thread by Alan T | last post: by
12 posts views Thread by samoore33 | last post: by
5 posts views Thread by Santel | last post: by

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.