You are developing a class library. Portions of your code ne

题目
单选题
You are developing a class library. Portions of your code need to access system environment variables. You need to force a runtime SecurityException only when callers that are higher in the call stack do not have the necessary permissions. Which call method should you use?()
A

set.Demand();

B

set.Assert();

C

set.PermitOnly();

D

set.Deny();

参考答案和解析
正确答案: B
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You are developing a Windows Comunication Foundation (WCF) service that is used to check the status of orders placed by customers.The following code segment is part of your service.(Line numbers are included for reference only.)01 [ServiceContract]02 public interface IStatus03 {04 [OperationContract]05 int GetOrderStatus(string orderNumber);06 }0708 class OrderService : IStatus09 {10 public int GetOrderStatus(string orderNumber)11 {12 ...13 }14 }1516 class Program17 {18 static void Main(string[] args)19 {202122 host.Open();23 ...24 }25 }You need to ensure that the service always listens at net.pipe://SupplyChainServer/Pipe.What should you do?()

A.

B.

C.

D.


参考答案:B

第2题:

You are developing a new version of an existing message contract named CustomerDetailsVersion1. The new version of the message contract must add a Department field of type String to the SOAP header.You create a new class named CustomerDetailsVersion2 that inherits from CustomerDetailsVersion1. You need to ensure that all client applications can consume the service.Which code segment should you use?()

A.

B.

C.

D.


参考答案:A

第3题:

Taking Notes in Class Taking good notes is a three-stage process _____________ (1) there are certain things you should do before class, during class, and after class. Before class. Review your notes from the previous class session before you come to class. This will help you remember what _____________ (2) and get you ready to understand new information your teacher provides. Also, complete all assigned readings before you come to class. During class. Keep your attention _____________ (3) what your teacher is saying. Listen for “signal statements” that tell you that what your teacher is about to say is important to write in your notes. Write quickly by writing ____________ (4) words such as “med” for “medicine”, using symbols such as “%” for “percent”, and writing short sentences. After class. Rewrite your notes to make them more complete by changing abbreviated words into whole words. Make your notes __________ (5) accurate by answering any questions you had when writing your notes in class. You may ask your teacher or other students for help.

1.

A、in that

B、in which

C、where

D、which

2.

A、was covered

B、is covered

C、covers

D、are covering

3.

A、focusing on

B、focus on

C、is focused on

D、focused on

4.

A、short

B、abbreviated

C、other

D、several

5.

A、very

B、quite

C、more

D、most


参考答案:BADBC

第4题:

You are developing a Windows Presentation Foundation (WPF) application The application is for commercial use and requires a valid license key to be entered. You create a project type of Class Library code to validate license keys You need to ensure that the user enters a valid license key during installation of the software. Which deployment should reference the class library?()

  • A、 Click Once
  • B、 Setup Project
  • C、 XBAP
  • D、 XCopy

正确答案:B

第5题:

You work as an application developer at Certkiller .com. Certkiller .com has been hired by a small local private school to develop a class library that will be used in an application named ManageAttendance for the purpose of managing student records.You are responsible for developing this class library. Certkiller .com has instructed you to create a collection in the application to store learners’ results. The school has informed you that they currently only have seven learners, but that this value will triple in the following year. Due to the limited resources, you need to ensure that the collection you create consumes a minimum amount of resources. What should you use to create the collection?()

  • A、 The HybridDictionary collection class.
  • B、 The HashTable collection class.
  • C、 The ListDictionary collection class.
  • D、 The StringCollection collection class.

正确答案:A

第6题:

You are developing a Windows Communication Foundation (WCF) service.You enable message logging, trace listeners, activity propagation, and tracing on the trace sources.You have the following code segment in the client application. (Line numbers are included for reference only.)01 Guid multiCallActivityId = Guid.NewGuid();02 TraceSource ts = new TraceSource("Multicall");03 Trace.CorrelationManager.ActivityId = multiCallActivityId;04You encounter errors when your client application consumes the service.You need to ensure that your client application can correlate tracing information with the service.Which code segment should you add at line 04?()

A.

B.

C.

D.


参考答案:C

第7题:

You are developing a Windows Communication Foundation (WCF) service that is hosted by a Windows Forms Application.The ServiceHost instance is created in the Form Constructor.You need to ensure that the service is not blocked while the UI thread is busy.What should you do?()

A. Decorate the service implementation class with the following line of code [ServiceBehavior(UseSyncronizationContext = false)]

B. Decorate the service implementation class with the following line of code [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]

C. Call the Invoke method of the form and supply a delegate.

D. Call the BeginInvoke method of the form and supply a delegate.


参考答案:A

第8题:

You are creating a class that performs complex financial calculations.The class contains a method named GetCurrentRate that retrieves the current interest rate and a variable named currRate that stores the current interest rate.You write serialized representations of the class.You need to write a code segment that updates the currRate variable with the current interest ratewhen an instance of the class is deserialized.Which code segment should you use?()

A.

B.

C.

D.


参考答案:D

第9题:

You are developing a Web application to display products. Products are displayed on different pages on your Web site. You want to create a user control to manage the display of products. You need a default visual implementation of the UI of the user control. In addition, you need to provide developers with the flexibility to change the layout and controls of the UI. Which three actions should you perform? ()

  • A、Apply the TemplateContainerAttribute to a property of type ITemplate. Pass the type of the template's naming container as the argument to the attribute.
  • B、Apply the TemplateContainerAttribute to the user control's class declaration.
  • C、Implement a property of type INamingContainer in the user control's code-behind class.
  • D、Implement a property of type ITemplate in the user control's code-behind class.
  • E、Define a new class that inherits from the ITemplate interface. Implement the InstantiateIn method of the ITemplate interface.

正确答案:A,D,E

第10题:

You need to call an unmanaged function from your managed code by using platform invoke services. What should you do?()

  • A、Create a class to hold DLL functions and then create prototype methods by using managed code.
  • B、Register your assembly by using COM and then reference your managed code from COM
  • C、Export a type library for your managed code.
  • D、Import a type library as an assembly and then create instances of COM object.

正确答案:A

更多相关问题