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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.