单项选择题

You work as an application developer at Certkiller .com. Certkiller .com has asked you to develop an application that monitors and controls the activities of a Windows service.You need to use the appropriate class to meet Certkiller .com’s requirements. What should you do?()

A. Use the ServiceBase class.
B. Use the ServiceInstaller class.
C. Use the ServiceManager class.
D. Use the ServiceController class.

热门 试题

单项选择题
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);