S
Steve
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 ?
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 ?