Re: System.UnauthorizedAccessException

From: Frank Mamone (frankmnospam_at_canada.com)
Date: 09/10/04


Date: Thu, 9 Sep 2004 18:14:57 -0400

I notice the IP address is in the private IP range. If the offending
server has a public IP , then it will not work if not properly routed. Check
with your network admin.

To troubleshoot, go on the server and login as the ASPNET account or an
account with the same privileges and try accessing the path manually and see
if it works.

If it doesn't then you have a network access problem. You need to eliminate
that possibility first.

-Frank Mamone

"Peter Afonin" <peter@gudzon.net> wrote in message
news:OKHdZVrlEHA.2680@TK2MSFTNGP15.phx.gbl...
> Hello Joyjit,
>
> It seems that I'm in a dead end. After I impersonated udentity as you
> suggested, everything worked on my machine, but when I put the application
> to the server - it didn't run. I described it in my post
> "Impersonate Identity doesn't work on the server". I fixed this by
> impersonating IWAM_SERVERNAME. After this I've lost access to the original
> folder again. I don't know what's happening.
>
> Thank you,
>
> Peter
>
> "Joyjit Mukherjee" <joyjit_mukherjee@hotmail.com> wrote in message
> news:O3twHCXlEHA.3648@TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > you need to impersonate the user under whose behalf the resource is
going
> to
> > be accessed. Put a <identity> tag in ur Web.Config as follows: -
> >
> > < identity impersonate = "true" userName = "Domain\username" password =
> > "password" />
> >
> > Regards
> > Joyjit
> >
> > "Peter Afonin" <peter@gudzon.net> wrote in message
> > news:%23HW$lQTlEHA.3632@TK2MSFTNGP09.phx.gbl...
> > > Hello,
> > >
> > > I'm using this code to access a network share from an asp.net page:
> > >
> > > Dim dir As DirectoryInfo = New DirectoryInfo("\\10.0.0.150\FormLib\")
> > > Dim files() As FileInfo = dir.GetFiles("*.eps")
> > >
> > > When I try to do it, I get this error:
> > >
> > > System.UnauthorizedAccessException: Access to the path
> > > "\\10.0.0.150\FormLib\" is denied. at
System.IO.__Error.WinIOError(Int32
> > > errorCode, String str) at
> > > System.IO.Directory.InternalGetFileDirectoryNames(String fullPath,
> String
> > > userPath, Boolean file) at System.IO.Directory.InternalGetFiles(String
> > path,
> > > String userPath, String searchPattern) at
> > > System.IO.DirectoryInfo.GetFiles(String searchPattern) at
> > > Wip7b.WorkInProcess.btnGetEPS_ServerClick(Object sender, EventArgs e)
> > >
> > > All permissions to this folder and a file share are set to
> > Everyone.Usually
> > > I don't have this problem. The only thing that is different about this
> > > particular machine that it is not a part of the domain to which all
> other
> > > PCs in our company belong, so I cannot access any users from our
Active
> > > Directory.
> > >
> > > This is a Win 2000 SP4 machine.
> > >
> > > I would greatly appreciate your help.
> > >
> > > Thank you,
> > >
> > > --
> > > Peter
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: System.UnauthorizedAccessException
    ... server has a public IP, then it will not work if not properly routed. ... If it doesn't then you have a network access problem. ... > Hello Joyjit, ... > impersonating IWAM_SERVERNAME. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Winlogon notification DLL and user token
    ... Have you tried impersonating the user in your DLL and then send ... something across the pipe to your COM server which then again ... if the logged-on user's desktop is visible or not. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: impersonation and accessing remote folder
    ... I am impersonating the user. ... client in this case are both on the same domain, all Windows 2000. ... > once passed to the IIS server, the same credentials cannot be passed ... >>access to the remote folder is denied. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Delegatoin w/ Protocol transition in a Windows 2000 native domain
    ... authentication is the only box checked) on the Exchange 2003 /exchange ... frontend-server by means of impersonating the user who's logged on ... This account is trusted for delegation. ... system" privelege on the ASP.NET server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • impersonation works on local xp not on web server
    ... The program I have written to change a password by impersonating an ... the Windows 2000 server the impersonation fails. ... #region Private Methods ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast