Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Could not find a part of the path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matías - 14 Mar 2006 02:25 GMT
I have two servers with windows 2003.

I have an app running under server 1 (asp 1.1) and I try to write files in
the server 2.

In the server 2, I have a full access to the directory, but I have the error
Could not find a part of the path

Thenks in advance
Michael Nemtsev - 14 Mar 2006 07:14 GMT
Hello Matías,

show your code

M> I have two servers with windows 2003.
M>
M> I have an app running under server 1 (asp 1.1) and I try to write
M> files in the server 2.
M>
M> In the server 2, I have a full access to the directory, but I have
M> the error Could not find a part of the path
M>
M> Thenks in advance
M>
---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Matías - 14 Mar 2006 14:11 GMT
Hi, the code is:

ruta = "\\hpr2k01\XML-Menu"

string direct = ruta + "/" +
String.Format("{0}_{1}",DateTime.Now.Minute.ToString(),DateTime.Now.Millisecond.ToString());
string FILENAME = direct + "/" +
String.Format("{0}_{1}.txt",DateTime.Now.Minute.ToString(),DateTime.Now.Second.ToString());

if(!Directory.Exists(direct))

Directory.CreateDirectory(direct);

//Get a StreamReader class that can be used to read the file

StreamWriter objStreamWriter;

objStreamWriter = File.AppendText(FILENAME);

//Now, read the entire file into a string

objStreamWriter.WriteLine("A user viewed this demo at: " +
DateTime.Now.ToString());

objStreamWriter.WriteLine(System.Configuration.ConfigurationSettings.AppSettings.Get("path-estilos"));

//Close the stream

objStreamWriter.Close();

> Hello Matías,
>
[quoted text clipped - 12 lines]
> "At times one remains faithful to a cause only because its opponents do
> not cease to be insipid." (c) Friedrich Nietzsche
Michael Nemtsev - 14 Mar 2006 20:20 GMT
Hello Matías,

use @ sign before path: ruta = @"\\hpr2k01\XML-Menu"

BTW, I can't see the error besides this one. It works fine. Check your permisions,
and try to create file in network folder manually

M> Hi, the code is:
M>
M> ruta = "\\hpr2k01\XML-Menu"
M>
M> string direct = ruta + "/" +
M> String.Format("{0}_{1}",DateTime.Now.Minute.ToString(),DateTime.Now.M
M> illisecond.ToString()); string FILENAME = direct + "/" +
M> String.Format("{0}_{1}.txt",DateTime.Now.Minute.ToString(),DateTime.N
M> ow.Second.ToString());
M>
M> if(!Directory.Exists(direct))
M>
M> Directory.CreateDirectory(direct);
M>
M> //Get a StreamReader class that can be used to read the file
M>
M> StreamWriter objStreamWriter;
M>
M> objStreamWriter = File.AppendText(FILENAME);
M>
M> //Now, read the entire file into a string
M>
M> objStreamWriter.WriteLine("A user viewed this demo at: " +
M> DateTime.Now.ToString());
M>
M> objStreamWriter.WriteLine(System.Configuration.ConfigurationSettings.
M> AppSettings.Get("path-estilos"));
M>
M> //Close the stream
M>
M> objStreamWriter.Close();
M>
M> "Michael Nemtsev" <nemtsev@msn.com> escribió en el mensaje
M> news:9cc1c863811d48c8155ee50051db@msnews.microsoft.com...
M>
>> Hello Matías,
>>
[quoted text clipped - 13 lines]
>> "At times one remains faithful to a cause only because its opponents
>> do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Matías - 15 Mar 2006 16:26 GMT
I found the solution to "Could not find a part of the path":

In both servers I create a normal user with the same username and password.

in the web.config of the app in the first server I use
<system.web>
 <identity impersonate="true" userName="(name)" password="(pass)" />
</system.web>

In the folder of the second server I shared the folder and I gave full
permitions to the user created and to the allusers I gave only read
permitions.

In the options security of the folder I gave full permitions to the new user

Thanks for all

> Hello Matías,
>
[quoted text clipped - 50 lines]
> "At times one remains faithful to a cause only because its opponents do
> not cease to be insipid." (c) Friedrich Nietzsche
Winista - 15 Mar 2006 19:37 GMT
How are you specifying the path?

Signature

Netomatix
http://www.netomatix.com

>I have two servers with windows 2003.
>
[quoted text clipped - 5 lines]
>
> Thenks in advance

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.