Cannot find a part of the path Error

A

Arthur

Hi All,
I know there have been previous posts with this topic but the issue for
most seems to be the security permissions on the shared drive. My
scenario is as follows :
I have IIS on local machine, I have code on a mapped drive in the
network.
I tried writing to a folder on the mapped drive and then also to a
folder in my C:, both give the same error "Cannot fnd a part of the
path". I gave the local folder FULL CONTROL to the user EVERYONE, still
doesnt make a difference.
My code is as follows :
try
{
FileStream File = new
FileStream(ConfigurationSettings.AppSettings["file_location"] +
System.DateTime.Now.Ticks.ToString() + ".xml", FileMode.Append,
FileAccess.Write);
System.Web.HttpContext.Current.Response.Write("Created the File
Stream");
StreamWriter sw = new StreamWriter(File);
sw.WriteLine(a.OuterXml);
sw.Close();
}
catch(Exception e)
{
Response.Write(e.Message);
Response.End();
}


Any help is greatly appreciated.
Thanks in advance,
Ben
 
A

Arthur

For any one interested, I resolved this issue:
1. Changed the "\" to "\\" in the web config entry for the folder path.
2. Most important, changed the folder to map to the drive where code
was running from(on the server) instead of on my local machine.

Just wanted to post my solution in this forum for anyone who has a
similar issue .
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,010
Latest member
MerrillEic

Latest Threads

Top