单项选择题
A.Move the loop code into the constructor of the service class from the OnStart method.
B.Drag a timer component onto the design surface of the service. Move the calls to the long-running procedure from the OnStart method into the Tick event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.
C.Add a class-level System.Timers.Timer variable to the service class code. Move the call to the DoWork method into the Elapsed event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.
D.Move the loop code from the OnStart method into the DoWork method.
单项选择题 You are developing an application that runs by using the credentials of the end user. Only users who are members of the Administrator group get permission to run the application. You write the following security code to protect sensitive data within the application.bool isAdmin=false; WindowsBuiltInRole role=WindowsBuiltInRole.Administrator; ...... if(!isAdmin) throw new Exception("User not permitted"); You need to add a code segment to this security code to ensure that the application throws an exception if a user is not a member of the Administrator group. Which code segment should you use?()
单项选择题 您正在开发一个协助用户进行电子调查的应用程序。调查由25个对错判断题组成。您需要执行下列任务:将每个答案预置为是。最大程度地减少每次调查使用的内存量。您应该选择哪个存储选项?()
单项选择题 您正在开发自定义集合类。您需要在类中创建方法。您需要确保在类中创建的方法返回与Foreach语句兼容的类型。该方法应满足哪个条件?()