What should you do?

You work as the application developer at Domain.com. Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are developing a .NET Framework 2.0 Windows application named TestAnalyzer.exe that will be used to monitor the Application event log of the local computer to find if any new events are generated by another application named BillNotify.exe which runs on the local computer named Certkiller -WS11.
Whenever a new event log entry is recorded the application must invoke the applicationLog_EntryWritten method in response.
You write the code below for the notification of new event log entries:
Dim applicationLog As EventLog = New EventLog(“Application”, “.”)
AddHandler applicationLog.EntryWritten,
AddressOf
applicationLog_EntryWritten
When you test the application you discover that there are no notifications generated. You are required to ensure that you are notified of a new event log entries.
What should you do?

You work as the application developer at Domain.com. Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are developing a .NET Framework 2.0 Windows application named TestAnalyzer.exe that will be used to monitor the Application event log of the local computer to find if any new events are generated by another application named BillNotify.exe which runs on the local computer named Certkiller -WS11.
Whenever a new event log entry is recorded the application must invoke the applicationLog_EntryWritten method in response.
You write the code below for the notification of new event log entries:
Dim applicationLog As EventLog = New EventLog(“Application”, “.”)
AddHandler applicationLog.EntryWritten,
AddressOf
applicationLog_EntryWritten
When you test the application you discover that there are no notifications generated. You are required to ensure that you are notified of a new event log entries.
What should you do?

A.
The applicationLog.EnableRaisingEvents property must be set to True

B.
The applicationLog.Log property must be set to BillNotify.exe

C.
The applicatioLogMachineName property must be set to Certkiller -WS11

D.
The applicationLog EnableRaisingEvents property must be set to False

Explanation:
The EnableRaisingEvents property of the applicationLog object must be set to true if you want to be notified whenever new entries have been written to the specified event log.
Incorrect Answers:
B: This method is incorrect as the Log property should be used to specify the name of the event log.
C: This is incorrect as this is a redundant operation and the EventLog object is already pointing to Certkiller -WS11.
D: This step is almost what you require but the property of the EnableRaisingEvents should be set to True.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


networkmanagers

networkmanagers

Correct answer is A