473,847 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with the message property of event log entries

I am reading events from an event log on a remote server. Certain events
will be put in a file or some other form of output. Everything works fine
but I am concerned a potential problem. Reading about how events are
handled, I found that the message property of an event is not recorded but
rather accessed from the source dll file. While testing my code I found that
when accessing the message property of a remote event log the message is
taken from the local dll file rather than the remote computers dll file.
According to the documentation it is possible for these messages to be
different if the dll files are not the same. This poses potential problems
because the message might be incorrect if it is not getting it from the
remote computer. I tested this by restricting permission to relevant
registry information locally, and sure enough my code throws an access
exception reading the registry.
I am trying to find out if there is some way to get the message from the
remote computer or if I can at least count on some events to be standardized
such as the ones in the security log.
I’m not sure if code will help but this example at least shows some of the
classes being used.

EventLog[] remoteEventLogs = EventLog.GetEve ntLogs(server);
foreach(EventLo g log in remoteEventLogs )
{
foreach (EventLogEntry entry in log)
{
Console.WriteLi ne(entry.messag e);
}
}

The registry keys are located at:
HKEY_LOCAL_MACH INE\System\Curr entControlSet\S ervices\Eventlo g
I disabled access to a specific event source of the application log for my
test (using regedt32 not regedit)
The exception is:
System.Security .SecurityExcept ion: Requested registry access is not allowed.
Let me know if more information is needed.

Thanks,
Paul

Nov 17 '05 #1
0 1089

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

Similar topics

3
5225
by: David Fraser | last post by:
Hi We are trying to debug a problem with services created using py2exe. It seems that these problems have arisen after services were installed and removed a few times. OK, first the actual problem we're seeing. After compiling a service with py2exe, running "service -install" and attempting to start it from the Services dialog, it pops up the message "Windows could not start the Service on Local Computer. For more information,...
2
2685
by: amol | last post by:
Hi, I have the following code to raise events when something gets written to the Application log. The problem I'm seeing is when a bunch of entries get written to the log at the same time (or within a couple of seconds of each other). I receive an event for the first entry, but the events for the other entries aren't triggered until another entry is written to the log. System.Diagnostics.EventLog eventLogToMonitor = new
1
886
by: Dean | last post by:
I've been using listboxes for a long time with no problems but I have a weird problem on a page that I can't figure out.... I'm filling a listbox, as usual with a dataset but when the user selects some entries, other entries get returned instead of the one selected. Also, some items in the list don't trigger the SelectedIndexChanged event and this is repeatable - the same items always fail to generate an event. All of this seems to...
10
4034
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
14
3279
by: Altman | last post by:
Ok I have a control that is inherited from another class. In the child I put msgbox(me.name) in the load event. What always pops up is the name of the parent class and not the name of the instance of the object. WHY? Also if I can figure this out I'm hoping that I can put this in the load event of the parent and still get it to work.
2
2484
by: r norman | last post by:
Please excuse the cross-posting. This question was raised in microsoft.public.dotnet.general but hasn't been answered so I am trying where I can. There are two of us who have the same problem in a service: the Timer::Tick event processor never gets called. We have set the timer interval, enabled it, and started it, but still nothing. In my case, I also have enabled an event handler to detect SessionSwitch, but that never gets...
6
2093
by: visionstate | last post by:
Hi there, I am building a database that requires cascading lists on a form. I currently have (I may be adding more later) 3 combo boxes on my form - Department, Surname and Forename. The user chooses the department they want and then the corresponding surnames from that department can be chosen from the Surname box and then the Forename depending on which Surname they chose. I then have a command button which produces the results of the...
11
1991
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback function is used (when the form opens) all runs well and everyone is happy. Then comes the problem - values are added to the recordset (ADO) that the callback function uses to populate the listbox. After the new values are added to the recordset, the...
3
3279
by: Dom | last post by:
I have a prgram with a webBrowser control. The user can click on a Linked Reference and the webBrowser control shows that site. Sometimes the URL (not my program, but the URL I am browsing to) has an "error on page", eg, a javascript error. My program then gives a dialog box, stating the error, and all my users think I wrote a crummy program. IE somehow gets around this. It will simply write the phrase "error on page" at the status...
0
9730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10983
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10647
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10706
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10338
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9482
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4119
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.