单项选择题
You work as an application developer at Certkiller .com. Certkiller .com has asked you to develop an application allows administrators to control Windows services dynamically without using the Services MMC.
You start by creating a class named LocalServiceController. You need to add the correct code to the LocalServiceController class to ensure that administrators are able to start local Windows services.What code should you use?()
A.A
B.B
C.C
D.D
相关考题
-
单项选择题
YouworkasanapplicationdeveloperatCertkiller.com.YouhavebeengiventhetaskofdevelopingaWindowsserviceapplicationthatregularlymonitorsotherWindowsservicesonthesamecomputer.ThisWindowsserviceapplicationmustalsologanyabnormalfilesystemactivity.YouhaveaddedthefollowingclasstotheWindowsserviceapplication:publicclassEnumerateService:ServiceBase{publicstaticEnumerateService(){this.ServiceName="EnumerateService";this.CanStop=true;}protectedoverridevoidOnStart(string[]args){//EnumerateallservicesandinitializetheFileSystemWatcher}protectedoverridevoidOnStop(){//StoptheFileSystemWatcherandperformcleanup}publicstaticvoidMain(){EnumerateServiceservice=newEnumerateService();}}YouthencreatetheinstallerfortheWindowsserviceapplication,andinstalltheWindowsserviceapplication.YouhaveconfiguredtheWindowsserviceStartuptypetoAutomatic,andrebootedthesystem.YouthentestthenewWindowsserviceapplication,andfindthatitisnotworking.Youneedtoensurethattheserviceisworkingproperly.Whatshouldyoudo?()
A. Override the OnBoot method instead of the OnStart method.
B. Replace the Main method code with the following code: EnumerateService service = new EnumerateService (); Service.Run ();
C. Override the OnLoad method instead of the OnStart method.
D. Replace the Main method code with the following code: EnumerateService service = new EnumerateService (); Run (service); -
单项选择题
You work as an application developer at Certkiller .com. You have recently created a Windows service application and need to define a Windows service class. What should you do?()
A.A
B.B
C.C
D.D -
单项选择题
YouworkasanapplicationdeveloperatCertkiller.com.YouhavebeengiventheresponsibilityofcreatingaclassnamedCalcSalarythatwilldeterminethesalariesofCertkiller.com’sstaff.TheCalcSalaryclassincludesmethodstoincrementanddecrementstaffsalaries.ThefollowingcodeisincludedintheCalcSalaryclass:publicclassCalcSalary{//forpromotionspublicstaticboolIncrementSalary(EmployeeEmp,doubleAmount){if(Emp.Status==QuarterlyReview.AboveGoals)Emp.Salary+=Amount;returntrue;}elsereturnfalse;}//fordemotionspublicstaticboolDecrementSalary(EmployeeEmp,doubleAmount){if(Emp.Status==QuarterlyReview.AboveGoals)Emp.Salary-=Amount;returntrue;}elsereturnfalse;}}YouwouldliketoinvoketheIncrementSalaryandDecrementSalarymethodsdynamicallyatruntimefromthesalesmanagerapplication,anddecidetocreateadelegatenamedSalaryDelegatetoinvokethem.YouneedtoensurethatyouusetheappropriatecodetodeclaretheSalaryDelegatedelegate.Whatisthecorrectlineofcode?()
A. public delegate bool Salary (Employee Emp, double Amount);
B. public bool Salary (Employee Emp, double Amount);
C. public event bool Salary (Employee Emp, double Amount);
D. public delegate void Salary (Employee Emp, double Amount);
