Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key


Play button


Play button




Click to flip

38 Cards in this Set

  • Front
  • Back
Should the EventLog class be used when using a partial trust environment?
No, security risk is too high
Which considerations should be taken into account when using EventLog objects?
- They can fill up overused
- They should be avoided in all partial trust environments
- They are potential resource hogs
What method of the EventLog should be used to clear an EventLog?
Use the Clear() method
Which logs are available by default in the Windows event log mechanism?
- Application
- System
- Security (readonly)
What is the EventLog.Source for?
The event source indicates what logs the event. It is often the name of the application. Source must be registered with a log. This is done automatically if WriteEntry is used. Mapping a source to another log requires a restart
How to create a new LOG and write an entry to it?
EventLog e = new EventLog();
e.Log = "MyNewLog";
e.Source = "MyComp";
e.WriteEntry("The entry");
// Source is mandatory as writting an entry
How to write to an existing log?
EventLog e = new EventLog();
e.Source = "MyComp";
e.Log = "ExistingLog";
What is the CorrelationManager for?
The CorrelationManager class provides methods used to store a logical operation identity in a thread-bound context and automatically tag each trace event generated by the thread with the stored identity.
What is the Debugger Class for? Describe the characteriscs
Enables communication with the Debugger. Only a few methods are of concern.
Break() and Log()
What happens when you use the Debugger.Log() method?
Whatever Listener is attached to the Debugger gets the message.
Describes the steps to add a Listener to a Debugger
1. Clear the attached listeners
2. DefaultTraceListener d = new DefaultTraceListener();
3. Trace.Listener.Add(d);
4. Debugger.Log(intLevel, strCategory, strMessage)
Describe the Debug class
The Debug class offer more granularity than the Debugger class. Important methods are Assert(), Fail, WriteIf, Print
What is the difference between the Debug.Write and Debug.Print method?
The Write method writes to the VS console and Print to the attached listeners
What are Debug Attributes?
Allow developers how to display the debug information about objects
What is DebuggerBrowserAttribute?
Never - No private members
Collapsed - elements are collapsed
RootHidden - Does not display the root but the child elements
What is DebuggerDisplayAttribute
Determines how a class or field is displayed in the debugger variable windows.
What is DebuggerHiddenAttribute?
All Breakpoints are ignored inside in the item it decorates
What is DebuggerNonUserCodeAttribute?
Debugger will step over the item it decorates
What is the DebuggerStepperBoundaryAttribute
It is used within DebuggerNonUserCodeAttribute, it allows to see the relevant portion of code.
Tells the Debugger to step over the code instead of hiding it.
If you want to take control over how it is displayed
This attribute lets you tell the debugger that you have an associated visualizer for the given class
What is the TraceSource class?
It provides a mechanism that enalbles the tracing of code execution as well as associating trace messages with their source.
What is the TraceSwitch class
It allows the developer to manipulate virtually every aspect of the TraceSource class
List Listener objects and describe them? Where can they be set?
DefaultTraceListener - basic Listener and writes to VS output window
TextWriterTraceListener -
directs output to text file or stream
XmlWriteTraceListener - enhanced functionality like StackTrace
EventLogTraceListener - DelimetedTraceListener - delimeter

All can be in code or in <system.diagnostics><trace><listeners> in web.config
What is the main purpose for PrformanceCounterCategory?
To manage and manipulate PerformaceCounter objects and their categories
Decribe the steps to implement a simple counter
1. Create a new CounterCreateDataCollection
2. Create a CounterCreateData object and add it to the collection
3. Create a PerformanceCounterCategory is it doesn't exist
4. Create a PerformanceCounter by passing the category name and the create CounterCreateData object
5. Initialize the RawValue of the PerformanceCounter
Name the two ways to start a Process?
With Command-Line argumennt and without
What classes are to use to start a Process?
Firstly use the ProcessInfo class to set the FileName, Arguments(optional), UserName, Password (both optional), UseShellExecute (set to false when using User/Pass).
Then pass the ProcessInfo instance to the Process.Start() method
What is a StackTrace?
It provides a convenient way to obtain a Stack trace an exception object or a specific thread from the current point in code. It contains a list of StackFrames, which is not intended to be used directly. LIFO
What is a process?
A process is an executing application, with an unique identifier to differentiate it from other processes. Processes are mechanisms that allow appliucation to run safely isolated from other applications.
What class is provided to managed sensitive data?
What is WMI?
Windows Management Instrumentation that allows you to monitor virtually every piece of the system (locally and remotley) as well as control the windows operating system
What standard does WMI use to represent systems, applications, network, devices, and other management
Common Information Model (CIM)
What is the ManagementEventWatcher class?
Allows for subscription information about events that occur within WMI context
What are Visualizers?
Powerful new feature of Visual Studio 2005 that allow developers to see virtually every aspect of any object in debug time
Retrieve the names of each pause service? Add name to myCollection.Add()
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM WIN£"_Service where State = 'Paused'");
foreach(ManagementObject svc in searcher.Get())
Write code that transfers the first 70bytes from a stream variable stream1 into a new byte array named byteArray. assign the transfered bytes to an int var byesTransfered
stream1.Read(byteArray, 0, 70);