473,398 Members | 2,812 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,398 software developers and data experts.

Could not find path error

Hi all,
I am referring to this article in MSDN :
http://msdn.microsoft.com/library/en.../logonuser.asp

While creating folder on the remote machine, we are specifying the UNC path
as per the example. But we get this error "could not find a part of the
path".

we are prefixing the path with @ symbol and also tried with the escaping the
"\\".
Path is correct and and all the permissions have been granted. ASP.net
application and the remote folder machine are in the same domain. We tried
with mapped drive as well , it did't work.

We are trying out the sample application you have sent. CreateFolder method
is invoked from the Default.appx.cs file's Page_load method and remote
folder path is passed to the CreateFolder method and it is shown below.

CreateFolder(@"\\mypath\shared", "IOFolder");
Here mypath is the remote machine and is in the same domain of Web
application. "shared" folder is shared for everyone and full access has been
given to all the users.

Below is the code snippet from the CreateFolder Method

try

{

DirectoryInfo dirInfo = new DirectoryInfo(strTragetLocation);

Response.Write(dirInfo.Exists);

string strFolderToCreate = strTragetLocation + "\\" + strFolder;

Directory.CreateDirectory(strFolderToCreate);

}

catch (Exception ex)

{

Response.Write(ex.Message);

return false;

}

In the above code DirectoryInfo.Exists method returns false and after that
it tries to CreateDirectory and it throws the following exception "Could not
find a part of the path \"\\\\mypath\\shared\."."

Any ideas ?


Nov 18 '05 #1
1 2224
the problem is probably permission. unless your asp.net account is a domain
account, it will not be able to access the share. if you must use a local
account, you will need to set the password, and create a matching local
account (with the same password) on the share, or use impersonation and fill
a domain account and password.

-- bruce (sqlwork.com)
"Steve" <an*******@discussions.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi all,
I am referring to this article in MSDN :
http://msdn.microsoft.com/library/en.../logonuser.asp

While creating folder on the remote machine, we are specifying the UNC path as per the example. But we get this error "could not find a part of the
path".

we are prefixing the path with @ symbol and also tried with the escaping the "\\".
Path is correct and and all the permissions have been granted. ASP.net
application and the remote folder machine are in the same domain. We tried
with mapped drive as well , it did't work.

We are trying out the sample application you have sent. CreateFolder method is invoked from the Default.appx.cs file's Page_load method and remote
folder path is passed to the CreateFolder method and it is shown below.

CreateFolder(@"\\mypath\shared", "IOFolder");
Here mypath is the remote machine and is in the same domain of Web
application. "shared" folder is shared for everyone and full access has been given to all the users.

Below is the code snippet from the CreateFolder Method

try

{

DirectoryInfo dirInfo = new DirectoryInfo(strTragetLocation);

Response.Write(dirInfo.Exists);

string strFolderToCreate = strTragetLocation + "\\" + strFolder;

Directory.CreateDirectory(strFolderToCreate);

}

catch (Exception ex)

{

Response.Write(ex.Message);

return false;

}

In the above code DirectoryInfo.Exists method returns false and after that it tries to CreateDirectory and it throws the following exception "Could not find a part of the path \"\\\\mypath\\shared\."."

Any ideas ?

Nov 18 '05 #2

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

Similar topics

1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
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...
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...
0
by: haylow | last post by:
Hi I am new to ASP.NET and am working on an application that runs on a webserver. The user will open up the web interface in a browser on their local machine and enter a path to a directory. I...
9
by: Clinton Frankland | last post by:
Hi, On a Windows 2000 Server when attempting to use System.IO.Directory.CreateDirectory(string.concat(Server.MapPath(""), "\verify")) I receive a System.IO.DirectoryNotFoundException error:...
14
by: Gianfranco | last post by:
Hi everybody, First of all, sorry for my english if it isn't perfect ;-p I have an error in an asp.net application. I have win2003 server, with iis 6. I'm developping with visual studio...
3
by: gogaz | last post by:
Hi, I know query in Subject line "Could not find a part of the path" has been replied before lots of time, but mine is bit different. My web server is windows 2003 R2 with both .net framework...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
1
by: ipramod | last post by:
Hi, I have a codebase which contains project for all the DLL's and another project for all UI presentations. When I try to open an aspx page on Visual Studio editor, I get following error on...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.