No, IUSR_xxxx is the account used to access local resources while
"impersonating" anonymous clients, it's a local account so it can't be used
to access network resources. Note that this account is meant to be used by
asp application, asp.net should use the config.web file to configure the
"anonymous" account.
ASPNET is a service account, so again it's a local account and as such isn't
used to authenticate. However, if the server running asp.net is a AD domain
member (W2K or more), the credentials used to authenticate are the machine
account credentials (domain\machinename$).
Here are a few options in order of complexity, note that all depends on the
OS you are running on the webserver and the network environment (domain, no
domain):
- When running in a domain (but I guess you are not), set the impersonating
account in your web.config file to a domain account with access privileges
to the share.
- When running in a workgoup, you have to set the impersonating account in
your web.config file to the same account as used when connecting from your
interactive session.
- Another option is to create a new logon session in code (calling
LogonUser() to obtain a logon token) and impersonate the logon token when
accessing the remote share, note that this requires PInvoke interop calls
(LogonUser()).
- You can also create a "use record", that is map the network share in code,
but this also requires PInvoke interop calls.
- And yet another option is to store the remote access code in a COM+
application that runs with fixed credentials having remote share access
privileges.
Willy.
Lam said:
right now it's using "IUSR" in my computer for anonymous access
is it the user that need to be assgined the right to access the network
drive?
I try to open the security tab on T drive (mapped network drive), I don't
see any place
where I can change the permissoin for IUSR, Do I need to change the user
to
be the one
from domain or from my local computer? I also try to change the user to
the
current user logged
on to the computer, it still don't work
thanks a lot for your guys' help
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote
in message news:
[email protected]...
Hi,
Normally you can use the UNC for the network share, now as nicholas said
the asp.net user do not have access to access the network. Either you change
the user under which the app runs or you give the asp.net user
permission.
cheers,
T is the network drive to a server
it's working cause I could browse it
the project is ASP.Net project. I write the ASPX page in C#
the application is running in local computer
so how can I make the drive available to my application?
Thanks a lot
"Nicholas Paldino [.NET/C# MVP]" <
[email protected]>
wrote
in
message Lam,
Are you sure that the drive mapping is available? If the
mapping
is
available, you should be able to pass that filename to whatever file
routines you want, and it should work.
Is this a Windows or an ASP.NET application? If it is an ASP.NET
application, the drive mappings might not be available (most likely)
to
the
account that the app is running under. Also, it most likely doesn't have
the rights to access the network as well.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
HI
anyone knows how can I open a mapped network file in C#?
I try string file = @"T:\file.txt"; it shows me the error:
"Could
not
find
a part of the path"
but if I copy the file to my C dirve, and use @"C:\file.txt"; it worked
Thanks a lot