Practice Questions

Question 1

Which of the following are valid message type values that may be written into the Event Log? [Select all that apply.]

  • A. Error

  • B. FailureAudit

  • C. Information

  • D. Kill

  • E. Warning

A1:

Answers A, B, C, and E are correct. The type of an Event Log message must be one of the EventLogEntryType enumerated values: Error, FailureAudit, Information, SuccessAudit, or Warning. Answer D is incorrect because the Kill method of the Process class is not a member of the EventLogEntryType values.

Question 2

Which of the following tasks can you perform using the EventLog class? [Select all that apply.]

  • A. Read entries from an Event Log on the local computer

  • B. Read entries from an Event Log on a remote computer

  • C. Receive an event when new entries are written to an Event Log on the local computer

  • D. Receive an event when new entries are written to an Event Log on a remote computer

A2:

Answers A, B, and C are correct. The EventLog object allows you to read the existing entries in any Event Log or to receive an event when a new entry is added to an Event Log. Answer D is incorrect because you cannot catch events from a remote computer.

Question 3

You have written an application that starts with a form that can be used to select which external module to access. If no user input is provided after 15 minutes, you want to close the process. Which of the following methods of the Process class would best fulfill this requirement?

  • A. Close

  • B. CloseMainWindow

  • C. Dispose

  • D. Kill

A3:

Answer B is correct. The CloseMainWindow method should be used to terminate a process with a user interface. Answers A and C are incorrect because the Process class does not include the Close and Dispose methods. Answer D is incorrect because the Kill method terminates a process without performing resource cleanup and therefore would not be the best solution here.

Question 4

You have written an application that monitors an Event Log in order to trigger a regular low-priority data update process only when the primary application process has completed. Although the primary process is writing to the Event Log and your application is able to read events from the log, your program fails to automatically trigger the desired event. What should you do within the code in order to configure the Event Log handler so that it can trigger your process?

  • A. Set its Enabled property to True

  • B. Set its Enabled property to False

  • C. Set its EnableRaisingEvents property to True

  • D. Set its EnableRaisingEvents property to False

A4:

Answer C is correct. You must set the EnableRaisingEvents property of an Event Log handler to True in order to allow it to raise events on the local system. Answers A and B are incorrect because an Enabled property is not used for this purpose, whereas answer D is incorrect because setting the EnableRaisingEvents property to False will prevent the handler from raising events.

Question 5

You want to obtain a listing of the Event Logs present on a particular computer. Which member of the EventLog class should you use for this purpose?

  • A. Entries property

  • B. GetEventLogs method

  • C. CreateEventSource method

  • D. Exists method

A5:

Answer B is correct. The GetEventLogs method returns an array of all the Event Logs on the computer. Answer A is incorrect because the Entries property includes the contents of a specified log rather than a listing of available logs. Answer C is incorrect because CreateEventSource is used to create a new source for an existing log, not to enumerate logs. Answer D is incorrect because the Exists method will tell you whether a specific Event Log is present, but it won't list all the available logs.

Question 6

Which of the following statements are true regarding performance counters? [Select all that apply.]

  • A. Performance counters are grouped into performance counter containers.

  • B. Each performance counter category has its own set of associated values.

  • C. Each performance counter instance has its own set of associated values.

  • D. Performance counter categories must include one or more performance counter instances.

  • E. You may only add performance counters to an existing performance counter category.

A6:

Answers A and C are correct. Performance counters are grouped into performance counter categories, and each performance counter instance has its own set of published values. Answer B is incorrect because performance counter values are published for each instance rather than for an entire performance category. Answer D is incorrect because a performance category might contain zero instances. Answer E is incorrect because you may not add performance counters to existing categories. Instead, you must create a new category, which may contain none, one, or multiple new performance counters.

Question 7

Which of the following default Event Logs may be written to on a local system? [Select all that apply.]

  • A. Application

  • B. Events

  • C. Security

  • D. Server

A7:

Answers A and D are correct. The Application and Server default Event Logs may be written to on a local system. Answer B is incorrect because there is no default Event Log named Events, whereas answer C is incorrect because the Security Event Log is read-only for .NET applications.

Question 8

Which of the following activities can you perform with the System.Diagnostics.Process class? [Select all that apply.]

  • A. Start a new instance of the Notepad application

  • B. Reboot Windows

  • C. Terminate an existing copy of Microsoft Word

  • D. Lower the priority of the Computer Browser service

A8:

Answers A and C are correct. You can launch a new application using the Process.Start method, or you can terminate an existing application by using the Process.Kill or Process.CloseMainWindow method. Answers B and D are incorrect because the Process class does not contain members for rebooting Windows or adjusting priorities.

Question 9

You have written an application that includes several initialization procedures that occur when the form is first loaded. Some users complain that the form often generates an error because the initialization procedures are not completing before user access is allowed. You want to fire an event to enable user access only after the initialization routine is completed. Which member of the Process class should you monitor to meet this requirement?

  • A. Exited

  • B. ExitTime

  • C. HasExited

  • D. StartInfo

  • E. WaitForExit

  • F. WaitForInputIdle

A9:

Answer F is correct. The WaitForInputIdle method causes a Process object to wait for an idle state, which will only occur after the initialization procedures have been completed. Answers A, B, C, and E are incorrect because they involve the termination of an application and would not be suitable to taking an action when the process must continue running. Answer D is incorrect because the StartInfo property is used to pass parameters and operating environment settings to the process during instantiation.

Question 10

You have created a custom performance counter that publishes a value representing how many records remain unprocessed. This value is decreased by 10 as each cycle processes a record batch, until it reaches zero. What method of the PerformanceCounter class would best suit this requirement?

  • A. Decrement

  • B. DecrementBy

  • C. Increment

  • D. IncrementBy

  • E. NextValue

A10:

Answer D is correct. The IncrementBy method is used to increment and decrement a published performance counter by an arbitrary value. Answers A and C are incorrect because the Decrement and Increment methods only adjust the published value by one. Answer B is incorrect because the PerformanceCounter class does not have a separate DecrementBy method. Answer E is incorrect because the NextValue method is used to return a newly sampled value rather than to publish a value.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net