Re: Could not find a part of the



Please let me know how should this be done :
impersonate some domain-user that *can*
access that share *and* use the UNC path (\\server\share) to access it.

My problem:
When trying to read the file the user selects in PDA it gives an error
message
DirectoryNotFoundException:could not find a part of the path.(The same code
works fine in my system and diff remote servers)

My Code:

Stream a = ReadStream(txtFilePath.Text);
Label1.Text = a.Length.ToString();
_______________________

using System.Security.Permissions;
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name =
"FullTrust")]
namespace FileBus
{

public Stream ReadStream(string pathSource)
{
FileStream f = new FileStream(pathSource, FileMode.Open,
FileAccess.Read);
Stream a = (Stream)f;
return a;
}
}

Please help.
T.Jeywin Lizy


"Hans Kesting" wrote:

While trying to create new File, i recieve the following error=
message: "System.IO.DirectoryNotFoundException: Could not find a part of the
= path=20 "Y:\Reports.pdf ". The Y: is shared folder of another system and it
maped to the local system. The path exists.

The Y: mapping is for *your* account, which is not the account the
website runs under. Moreover, this ASPNET account is a local account
with limited priviledges. It can not access the network for example.
You might need to van the site impersonate some domain-user that *can*
access that share *and* use the UNC path (\\server\share) to access it.

Hans Kesting



.



Relevant Pages

  • Re: Error accessing MS Access database with Linked Tables on files
    ... of using UNC path. ... How can I check that my app is running under the local anonymous account? ... that I have set (unchecking the "Allow IIS to control passwords" checkbox). ... ¤ I have a ASP.Net application that uses a MS Access database. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: debugging ASP NET in a remote web server with remote file serv
    ... this is likely a typical remote access problem. ... In IIS virtual dir's Home directory setting panel, when we specify UNC ... That is used to specify an account to ... connect to that UNC path from your local box. ...
    (microsoft.public.vsnet.debugging)
  • Re: Windows 2003 services dont have access to mapped drives
    ... third party applications whose installation instructions mention that the ... But it is hard to complain about such ... account and set the service to run as this account. ... I can not use the UNC path without recoding this ...
    (microsoft.public.windows.server.security)
  • Re: Problem using a UNC Path within a COM component in asp.net
    ... If the application is run directly from Visual Studio, the UNC path works.. ... the same code running under IIS fails. ... I think it works using your user account and fails using the webserver ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Impersonation in ASP.NET
    ... Putting the full UNC path in it ... Didn't help but the fact that the error message was quite generic in all ... blah blah blah'. ... same error message you get if you don't call Impersonate. ...
    (microsoft.public.dotnet.languages.csharp)