473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Writing to eventlog

Hello!

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?

Leszek
Jan 18 '06 #1
3 1055
Joe
Dear Leszek:

Due to security reason, i think web application may not access the registry
content.

Hope this can help u!
Regards,
Joe Tsui

"Leszek" wrote:
Hello!

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?

Leszek

Jan 18 '06 #2
"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.
Jan 18 '06 #3
Thank you very much! It was that! :)
Użytkownik "Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> napisał w wiadomo¶ci
news:ep**************@TK2MSFTNGP14.phx.gbl...
"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.

Jan 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jacob Colding | last post by:
Hello, I have created a a logging mechanism, that writes mesages to a custom event log. On each check it verifies whether the requested source is registered to the "IPS" log. If not, it changes...
2
by: Scott Vercuski | last post by:
Everyone, I'm having trouble writing an event to the event log. Here is the chunk of code I currently have. ----------------------------------------------------------------------- Private...
5
by: David Conorozzo | last post by:
I am able to create new sources using CreateEventSource. I can call GetEventLogs, I can delete sources, I can see if sources exist BUT, as soon as I try a "WriteEntry", I get an exception: ...
2
by: Marauderz | last post by:
OK this just seems to be a common question being asked around here, I've tried Google Grouping the question but I still haven't came up with a solution yet. So here goes... I'm getting the...
6
by: MattC | last post by:
I have some code that correctly writes to the eventlog on my local machine. I have installed the application on the Live server and all is not well, no event log entries. My development box...
2
by: MattB | last post by:
I'm writing some code to log errors in a web app (vb/asp.net). I found a straightforward-looking example here: http://www.c-sharpcorner.com/Code/2002/May/CustomErrorHandlingASPNEt.asp But mine...
0
by: Karthik Srinivasan | last post by:
Hi, My web application which runs on Windows 2003 server writes to EventLog during application startup but I get the following exception Requested registry access is not allowed. at...
9
by: Jerry C | last post by:
I am trying to write to the errorlog and I am getting the error Cannot open log for source 'Application'. You may not have write access. This is the code: Dim Logevent As New...
10
by: David Thielen | last post by:
Hi; I am trying to write to the event log using: public const string EVENT_LOG_NAME = "Windward Portal"; if (!EventLog.SourceExists(EVENT_LOG_NAME)) EventLog.CreateEventSource(EVENT_LOG_NAME,...
2
by: =?Utf-8?B?REo=?= | last post by:
I've created a new EventLog for mail services in my web application. Each time a mail is sent, it is recorded in the eventlog for later review. This works fine when I am on my development machine...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.