473,804 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating Directories with ASP.NET and C# code

Con is the file name for a reserved device name(i think
it is for console). So you cannot create a file with
name 'con'. choose some other name

senthil

-----Original Message-----
Hi everyone, I am having a problem with creating directories using theDirectory classes static member function CreateDirectory .

Here is the following code that I am trying to run that is causing theproblem.
string patient_path = @"c:\inetpub\ww wroot\EMRWeb\Pa tient_Files\304 0"Directory.Crea teDirectory(pat ient_path);
Directory.Crea teDirectory(pat ient_path + @"\RAD");
Directory.Crea teDirectory(pat ient_path + @"\MISC");
Directory.Crea teDirectory(pat ient_path + @"\LAB");
Directory.Crea teDirectory(pat ient_path + @"\CON");

when the following code runs, the last line always gives the followingerror:
"could not find a part of the path c:\"
The other CreateDirectory calls create the directories properly, so it mustbe something with the name of the path
"c:\inetpub\ww wroot\EMRWeb\Pa tient_Files\304 0\CON"

I have also tried usually the following substitue code to the same thing butit also gives a error when creating the CON subfolder:

DirectoryInf o dir = new DirectoryInfo(p atient_path);
dir.Create() ;
dir.CreateSubd irectory("RAD") ;
dir.CreateSubd irectory("MISC" );
dir.CreateSubd irectory("LAB") ;
dir.CreateSubd irectory("CON") ;
I don't think it is a problem with permissions because the other directoriesare created properly, but these are the security and permission settings.The identity of the asp.net application is running under the default ASPNETuser account created by .NET framework. The ASPNET account has fullcontroll access folder "c:\inetpub\www root\EMRWeb\Pat ient_Files" and thepermissions are inherited for any subfolders.

Any help on this matter would be greatly appreciated

thanks

Babak
.

Nov 17 '05 #1
1 3030
Thanks.. that did the trick.

"Senthil" <to********@hot mail.com> wrote in message
news:06******** *************** *****@phx.gbl.. .
Con is the file name for a reserved device name(i think
it is for console). So you cannot create a file with
name 'con'. choose some other name

senthil

-----Original Message-----
Hi everyone, I am having a problem with creating

directories using the
Directory classes static member function CreateDirectory .

Here is the following code that I am trying to run that

is causing the
problem.
string patient_path =

@"c:\inetpub\ww wroot\EMRWeb\Pa tient_Files\304 0"
Directory.Crea teDirectory(pat ient_path);
Directory.Crea teDirectory(pat ient_path + @"\RAD");
Directory.Crea teDirectory(pat ient_path + @"\MISC");
Directory.Crea teDirectory(pat ient_path + @"\LAB");
Directory.Crea teDirectory(pat ient_path + @"\CON");

when the following code runs, the last line always gives

the following
error:
"could not find a part of the path c:\"
The other CreateDirectory calls create the directories

properly, so it must
be something with the name of the path
"c:\inetpub\ww wroot\EMRWeb\Pa tient_Files\304 0\CON"

I have also tried usually the following substitue code

to the same thing but
it also gives a error when creating the CON subfolder:

DirectoryInf o dir = new DirectoryInfo(p atient_path);
dir.Create() ;
dir.CreateSubd irectory("RAD") ;
dir.CreateSubd irectory("MISC" );
dir.CreateSubd irectory("LAB") ;
dir.CreateSubd irectory("CON") ;
I don't think it is a problem with permissions because

the other directories
are created properly, but these are the security and

permission settings.
The identity of the asp.net application is running under

the default ASPNET
user account created by .NET framework. The ASPNET

account has full
controll access

folder "c:\inetpub\www root\EMRWeb\Pat ient_Files" and the
permissions are inherited for any subfolders.

Any help on this matter would be greatly appreciated

thanks

Babak
.

Nov 17 '05 #2

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

Similar topics

1
307
by: Ricco DeCicco | last post by:
Hi All I have just reinstalled VStudio.Net (VB.Net) and the .Net Framewor and I can successfully open an existing project for editin 'UserControlSample' When I try to create a new project (either Windows or Web) I get th following error ------
3
2016
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the virtual directory on my pc the directory does not exist. If i create the folder from explorer then select hide/show files within vs.net I see the directory I just created. When I include that directory in my project by right clicking and selecting...
6
3538
by: Ferrari, Eduardo | last post by:
Hi all! I'm trying to create this XML file: <?xml version="1.0" encoding="utf-8" ?> <Build type="Daily" sync="True" compile="True" assemble="True" > <Sync version="1.0.0.0" branch="QA"> <Directories basePath="//OpicsPlus/Source/Release" /> </Sync>
6
3672
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a part of the path "D:\". My site is hosted on a public ISP that for obvious security reasons does not allow my read access above my wwwroot folder which seems to be a problem when trying to create directories... Is there any way to solve this?
3
1478
by: Stelrad Doulton | last post by:
Hi, I am having a strange problem on IIS 6.0. I am trying to create directories under a virtual directory on the fly to which I will upload files and retrieve these files later. I am having 2 problems: 1. I am using the code below to create a directory:
2
5388
by: Lucky | last post by:
Hello Guys, after long long time. i'm back again with some questions. right now i'm developing a code that fetch the list of websites from IIS 5.0 or later and also cretes the Virtual Directory for a website in IIS 5.0 or later. interesting thing is i don't know how to do it. i tried to find out namespace or library in VS.NET 2.0, if there is any, but i failed to found one.
6
1782
by: Charlie Bear | last post by:
i'm really stuck with this one can anyone help! i have a website that uses c#. it creates a series of directories and files from an xml source. when the xml changes, the directory that the change applies to is deleted and recreated. All the children for that directory are also re created (as the parent directory then has a different name). the problem i have is that *sometimes* the files or directories don't get created. It either...
3
2010
by: veaux | last post by:
Adobe has WAY to many forums and I wasn't sure which was correct so thought I'd try here first. I'm trying to see if there is a product that will allow us to create a large (1,100 pg) directory, similar to creating one with MS Word. We have Access tables and want to create a healthcare provider directory. Table has ~30,000 records. We'd also want to create a master index and TOC. We want to set this up so each time we update the...
0
1080
by: david wright | last post by:
--- On Fri, 9/5/08, srinivasan srinivas <sri_annauni@yahoo.co.inwrote: this appears to be working, what where you expecting? "An upper case "S" means there is no executable permission, but the set group id function is active- that is, a file in this directory will belong to the same group id as the directory itself." If the parent directory has the set group id set, the child will as well. i.e.
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.