"Leszek" <ma***@zegarek.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I'm creating application, that will get data from SQL and show it. The end
of it is writing to log informations from which table it was readed.
And there is a problem - Requested registry acces is not allowed.
I know, that it is running in context of ASP.NET (or Network Service), but
how can i do this, that will run as "someuser", that will be a domain
user?
Maybe there is other method for it?
If your app is running on an intranet server that you or your company
controls, you can do this easily with impersonation. Basically, you create a
domain user account and tell your app run under that account. Then, you
assign whatever privileges you need to the account to make your app work. Do
a Google search for ASP.NET & impersonation. If necessary, you can encrypt
the account's username and password using the ASPNET_SETREG utility.
However, if this is a public website hosted with a 3rd party ISP, chances
are you won't be able to do any of the above, so you'll have to find another
solution. One thing I do is, instead of writing application errors to the
Event log, I email them to myself - not ideal, but it works.