473,394 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Cannot find a part of the path Error

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("Cre ated 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

Sep 13 '06 #1
1 1728
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 .
Arthur wrote:
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("Cre ated 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
Sep 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
3
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
0
by: Terry | last post by:
When launching file 'eSurvey.aspx' via the browser the following error occurs. However, when I test the 'eSurvey.aspx' file via Visual Studio, it works without errors. Why? And, how can I...
9
by: Ben | last post by:
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...
2
by: cmt | last post by:
Greetings! I have an asp page that writes out a URL that points to files on a network drive. It has been working fine up until a week ago. I haven't made any changes to the server or code, so...
0
by: Tifer | last post by:
Hello, I am building my first .Net Application. The first couple of Publish and Installs I did went fine. But after a couple of builds, I get a modal dialogue box error every time upon trying...
9
by: reachmsn | last post by:
Hi, At the url http://www.python.org/doc/essays/graphs.html there is some code by Guido Van Rossum for computing paths through a graph - I have pasted it below for reference - Let's write a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.