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 / ASP.NET / Security / October 2004

Tip: Looking for answers? Try searching our database.

Could not find path error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 18 Oct 2004 13:26 GMT
Hi all,
I am referring to this article in MSDN :
http://msdn.microsoft.com/library/en-us/secauthn/security/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 ?
bruce barker - 18 Oct 2004 17:17 GMT
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)

> Hi all,
> I am referring to this article in MSDN :
[quoted text clipped - 50 lines]
>
> Any ideas ?

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.