C
Chris
Hi,
I have the following code, in which I'm trying to create a new folder
inside a UNC path:
DirectoryInfo oDir = new DirectoryInfo("\\\\server\\folder\\" +
System.DateTime.Now.ToString("MM-dd-yy"));
if (oDir.Exists == false)
{
try
{
oDir.Create();
Response.Write("Created file");
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString() +
"<br>");
}
}
When I try to run it, I get the following error:
Access to the path ..... is denied.
I have identity impersonate=true in my web config and I'm
impersonating in the code, so the proper user/permissions should be
used when it tries to create the folder, but it only works when I run
a local debug. I can copy files to the folder, if it exists.
Suggestions?
I have the following code, in which I'm trying to create a new folder
inside a UNC path:
DirectoryInfo oDir = new DirectoryInfo("\\\\server\\folder\\" +
System.DateTime.Now.ToString("MM-dd-yy"));
if (oDir.Exists == false)
{
try
{
oDir.Create();
Response.Write("Created file");
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString() +
"<br>");
}
}
When I try to run it, I get the following error:
Access to the path ..... is denied.
I have identity impersonate=true in my web config and I'm
impersonating in the code, so the proper user/permissions should be
used when it tries to create the folder, but it only works when I run
a local debug. I can copy files to the folder, if it exists.
Suggestions?