469,922 Members | 2,147 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,922 developers. It's quick & easy.

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 2061
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Clinton Frankland | last post: by
14 posts views Thread by Gianfranco | last post: by
3 posts views Thread by gogaz | last post: by
1 post views Thread by ipramod | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.