Practice Test

Question 1You develop a customer contact-management application using Visual Studio .NET. You use the methods of the Trace and Debug classes to log serious error messages encountered during program execution. You want to record all such errors in the Windows event log. You do not want any duplicate entries for error messages in the event log. In what two ways can you add a listener to the Windows event log?
  • A.

    EventLogTraceListener traceListener =
        new EventLogTraceListener("CustomEventLog");
    Trace.Listeners.Add(traceListener);
    
  • B.

    EventLogTraceListener traceListener =
        new EventLogTraceListener("CustomEventLog");
    Trace.Listeners.Add(traceListener);
    Debug.Listeners.Add(traceListener);
    
  • C.

     EventLogTraceListener traceListener = new EventLogTraceListener("CustomEventLog"); ...

Get Developing and Implementing Windows®-Based Applications with Visual C#™ .NET and Visual Studio® .NET Exam Cram™ 2 (Exam 70-316) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.