Question:

You develop a service application named FileService. You deploy the service application to multiple servers on your network.

You implement the following code segment. (Line numbers are included for reference only.)

01 public void StartService(string serverName){

02 ServiceController crtl = new

03 ServiceController("FileService");

04 if (crtl.Status == ServiceControllerStatus.Stopped){

05 }

06 }

You need to develop a routine that will start FileService if it stops. The routine must start FileService on the server identified by the serverName input parameter.

Which two lines of code should you add to the code segment? (Each correct answer presents part of the solution. Choose two.)

 

A Insert the following line of code between lines 03 and 04:
crtl.Site.Name = serverName; 

B  Insert the following line of code between lines 04 and 05:
crtl.ExecuteCommand(0); 

C Insert the following line of code between lines 04 and 05:
crtl.Continue(); 

D Insert the following line of code between lines 04 and 05:
crtl.Start(); 

E Insert the following line of code between lines 03 and 04:
crtl.ServiceName = serverName; 

F Insert the following line of code between lines 03 and 04:
crtl.MachineName = serverName; 

+ Answer
+ Report
Total Preview: 889

Copyright © 2024. Powered by Intellect Software Ltd