New Folder in a UNC Path

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top