Question:

You are testing a newly developed method named PersistToDB. This method accepts a parameter of type EventLogEntry. This method does not return a value.

You need to create a code segment that helps you to test the method. The code segment must read entries from the application log of local computers and then pass the entries on to the PersistToDB method. The code block must pass only events of type Error or Warning from the source MySource to the PersistToDB method.

Which code segment should you use?

 

A EventLog= myLog = gcnew EventLog("Application", "."); for each (EventLogEntry= entry in myLog->Entries) {
if (entry->Source == "MySource") {
PersistToDB(entry);
}
}
"A Composite Solution With Just One Click" - Certification Guaranteed 225 Microsoft 70-536 Exam 

B EventLog= myLog = gcnew EventLog("Application", "."); for each (EventLogEntry= entry in myLog->Entries) {
if (entry->Source == "MySource") {
if (entry->EntryType == EventLogEntryType::Error ||
entry->EntryType == EventLogEntryType::Warning) {
PersistToDB(entry);
}
}
} 

C EventLog= myLog = gcnew EventLog("Application", "."); myLog->Source = "MySource";
for each (EventLogEntry= entry in myLog->Entries) {
if (entry->EntryType == (EventLogEntryType::Error &
EventLogEntryType::Warning)) {
PersistToDB(entry);
}
} 

D EventLog= myLog = gcnew EventLog("Application", "."); myLog->Source = "MySource";
for each (EventLogEntry= entry in myLog->Entries) {
if (entry->EntryType == EventLogEntryType::Error || entry->EntryType == EventLogEntryType::Warning) {
PersistToDB(entry);
}
} 

+ Answer
+ Report
Total Preview: 735

Copyright © 2024. Powered by Intellect Software Ltd