Question:
You need to write a code segment that performs the following tasks:
Retrieves the name of each paused service.
Passes the name to the Add method of Collection1.
Which code segment should you use?
A ManagementObjectSearcher= searcher =
gcnew ManagementObjectSearcher( "Select * from Win32_Service");
for each (ManagementObject= svc in searcher->Get()) { if ((String=) svc["State"] == "'Paused'") {
Collection1->Add(svc["DisplayName"]);
}
"A Composite Solution With Just One Click" - Certification Guaranteed 258 Microsoft 70-536 Exam
}B ManagementObjectSearcher= searcher =
gcnew ManagementObjectSearcher(
"Select * from Win32_Service", "State = 'Paused'");
for each (ManagementObject= svc in searcher->Get()) { Collection1->Add(svc["DisplayName"]);
}C ManagementObjectSearcher= searcher =
gcnew ManagementObjectSearcher(
"Select * from Win32_Service where State = 'Paused'"); for each (ManagementObject= svc in searcher->Get()) { Collection1->Add(svc["DisplayName"]);
}D ManagementObjectSearcher= searcher =
gcnew ManagementObjectSearcher();
searcher->Scope = gcnew ManagementScope("Win32_Service"); for each (ManagementObject= svc in searcher->Get()) { if ((String=)svc["State"] == "Paused") {
Collection1->Add(svc["DisplayName"]);
}
}
+ AnswerC
+ Report