Re: System.UnauthorizedAccessException
From: Frank Mamone (frankmnospam_at_canada.com)
Date: 09/10/04
- Next message: Paul Roberts: "Re: Connect to Sql server using DSN?"
- Previous message: Peter Afonin: "Re: System.UnauthorizedAccessException"
- In reply to: Peter Afonin: "Re: System.UnauthorizedAccessException"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
> > >
> > >
> >
> >
>
>
- Next message: Paul Roberts: "Re: Connect to Sql server using DSN?"
- Previous message: Peter Afonin: "Re: System.UnauthorizedAccessException"
- In reply to: Peter Afonin: "Re: System.UnauthorizedAccessException"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|