C
C not so sharp
Greetings!
I'm developing a file repository system in ASP.Net with C#. However, I am
having problems getting the environment to cooperate. Here is the scenario:
When a new user is created, I create their file folder as follows:
string strUserDir = "Dir"+ strNewID;
string strFileDir = ConfigurationSettings.AppSettings["DirectoryName"]; //
Defaults to "Uploads"
string strNewDir = "\\" + strFileDir + "\\" strUserDir;
if ( !Directory.Exists (Request.MapPath(.) + strNewDir ) )
{
Directory.CreateDirectory( Request.MapPath(.) + strNewDir();
}
This will create a folder called Dir10001 in the Uploads folder. However,
this is being created under the application root :
c:\inetpubs\wwwroot\Promotions
so it looks like c:\inetpub\wwwroot\PromotionsUploads\Dir10001.
I'd like it to create in c:\Uploads so it would look like
c:\Uploads\Dir10001.
How do I do this with MapPath?
I'm developing a file repository system in ASP.Net with C#. However, I am
having problems getting the environment to cooperate. Here is the scenario:
When a new user is created, I create their file folder as follows:
string strUserDir = "Dir"+ strNewID;
string strFileDir = ConfigurationSettings.AppSettings["DirectoryName"]; //
Defaults to "Uploads"
string strNewDir = "\\" + strFileDir + "\\" strUserDir;
if ( !Directory.Exists (Request.MapPath(.) + strNewDir ) )
{
Directory.CreateDirectory( Request.MapPath(.) + strNewDir();
}
This will create a folder called Dir10001 in the Uploads folder. However,
this is being created under the application root :
c:\inetpubs\wwwroot\Promotions
so it looks like c:\inetpub\wwwroot\PromotionsUploads\Dir10001.
I'd like it to create in c:\Uploads so it would look like
c:\Uploads\Dir10001.
How do I do this with MapPath?