Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Could not find path error

Reply
Thread Tools

Could not find path error

 
 
Steve
Guest
Posts: n/a
 
      10-18-2004
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 ?




 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      10-18-2004
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" <> wrote in message
news:...
> 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 ?
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder creation error: "Could not find a part of the path" error E. Kwong ASP .Net Web Controls 0 11-06-2006 11:20 PM
Re: Error: Could not find a part of the path Phil Winstanley [Microsoft MVP ASP.NET] ASP .Net 0 05-21-2004 09:35 AM
Error: Could not find a part of the path jessica ASP .Net 0 05-20-2004 04:16 AM
Error: Could not find a part of the path / Reading and Writing to files in ASP.Net TC ASP .Net 3 05-19-2004 12:00 AM
"Could not find a part of the path" error dsh ASP .Net 0 01-15-2004 09:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57