473,386 Members | 1,803 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,386 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 5481

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: TTD | last post by:
Hello, I need to create a directory in code, but when de directory already exists, I get err.number 75. Since the creation already is in the part where a former error is sent, I can't catch...
9
by: Sheldon Cohen | last post by:
Hello, I am using c# and running a site that is on a shared host. The code in question is supposed to create a new directory that is coming out of a text box. It works fine on my computer, but...
4
by: Elmo Watson | last post by:
Is there a way, with the System.IO class, to do a recursive list of a directory structure? For instance, in DirectoryInfo, you have GetDirectories and GetFiles .... In Directory, you have...
1
by: Steven J. Reed | last post by:
I am trying to find out is a folder exists within a share on a server. I can successfully determine if a file exists within the share, but I can't figure out how to determine if it's parent folder...
2
by: Rose winsle | last post by:
Hi guys ... I just wanted to create virtual directory using VB.net . i can manage that ... when i create the virtual directory how can i set anonymous access off. following is my code...
6
by: Alan T | last post by:
How do I check if the directory path is valid and exists ? eg. \\myserver\temp\\\\\\ c:\temp\\doc\\\\\\root1
12
by: samoore33 | last post by:
I found a real nice article on how to copy a directory on MSDN. The only problem is that I can not figure out how to get the namespace Microsoft.VisualBasic.MyServices. I wanted to know if anyone...
2
by: CCLeasing | last post by:
If (Directory.Exists(@"c:\indigo\" + txtOfficial + @"\" + comOffice.Text + @"\" + numTerm.Value.ToString())) { storereport(); } else { Directory.CreateDirectory(@"c:\indigo\" + txtOfficial +...
5
by: Santel | last post by:
Hi, If I use Directory.Exists("C://Documents and Settings//username// Testing); it always returns false. But the directory is existing in the specified folder. It is not searching any folders...
4
by: ndedhia1 | last post by:
Hi. I am writing a java program in which I want to ftp a file to another unix box. First I have to check if the directory exists in which I am ftping into and if it does not exist, I have to create...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.