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\wwwroot\EMRWeb\Patient_Files\3040"Directory.CreateDirectory(patient_path);
Directory.CreateDirectory(patient_path + @"\RAD");
Directory.CreateDirectory(patient_path + @"\MISC");
Directory.CreateDirectory(patient_path + @"\LAB");
Directory.CreateDirectory(patient_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\wwwroot\EMRWeb\Patient_Files\3040\CON "
I have also tried usually the following substitue code
to the same thing butit also gives a error when creating the CON subfolder:
DirectoryInfo dir = new DirectoryInfo(patient_path);
dir.Create();
dir.CreateSubdirectory("RAD");
dir.CreateSubdirectory("MISC");
dir.CreateSubdirectory("LAB");
dir.CreateSubdirectory("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\wwwroot\EMRWeb\Patient_Files" and thepermissions are inherited for any subfolders.
Any help on this matter would be greatly appreciated
thanks
Babak
.