You are developing a class library that will open the networ

题目
单选题
You are developing a class library that will open the network socket connections to computers on the network. You will deploy the class library to the global assembly cache and grant it full trust. You write the following code to ensure usage of the socket connections.  SocketPermission permission =   new SocketPermission(PermissionState.Unrestricted);  permission.Assert(); Some of the applications that use the class library might not have the necessary permissions to open the network socket connections.You need to cancel the assertion. Which code segment should you use?()
A

CodeAccessPermission.RevertAssert();

B

CodeAccessPermission.RevertDeny();

C

permission.Deny();

D

permission.PermitOnly();

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.)01 [ServiceContract()]02 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]03 public Class LibraryService04 {05 public Book GetBookByTitle(string title)06 {07 ...08 }0910 [WebGet(UriTemplate = "Book/{id}")]11 public Book GetBookById(string id)12 {13 ...14 }15 }Library patrons want the ability to search the catalog by title.You need to ensure that the GetBookByTitle method is exposed as a service method.Which code segment should you insert at line 04?()

A. [WebGet(UriTemplate = "Book/{title}")]

B. [WebGet(UriTemplate = "BookByTitle/{title}")]

C. [WebGet(UriTemplate = "Book/{titleToSearch}")]

D. [WebGet(UriTemplate = "{titleToSearch}")]


参考答案:B

第2题:

You are developing a Windows Presentation Foundation (WPF) application that displays opportunities from List<T.. class named Lead. The Lead class contains the properties Title and Revenue.You add a DataGrid control named dgQualifiedLeads to the MainWindow.xaml file. You set the ItemsSource property to Leads as follows.You need to ensure that CollectionViewSource is used to filter the list to display only Lead objects with revenue ...What should you do ?()

A.

B.

C.

D.


参考答案:C

第3题:

You develop a Web control. The Web control consists of labels and associated text boxes.You need to ensure that the Web control has both toolbox and visual designer support. What should you do?()

A. Add a Web Control Library project to your solution. Define a class that inherits from CompositeControl.

B. Add a Windows Control Library project to your solution. Define a class that inherits from UserControl.

C. Add a Web User Control to your project. Define a class that inherits from UserControl.

D. Add a Mobile Web User Control to your project. Define a class that inherits from MobileUserControl.


参考答案:A

第4题:

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

第5题:

You want to provide a tool that allows users quick access to form modules, by listing them in an Explorer-style interface. Which reusable component do you use?()

  • A、ActiveX controls 
  • B、Calendar Class 
  • C、Standard Object Library 
  • D、Picklist Class 
  • E、Wizard Class 
  • F、Navigator Class

正确答案:F

第6题:

You are developing a Windows Service. The Windows Service will host a Windows Communication Foundation (WCF) service.The Windows Service class will inherit from ServiceBase.You need to ensure that the WCF service starts when the Windows Service is restarted.What should you do in the Windows Service class?()

A.

B.

C.

D.


参考答案:B

第7题:

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

第8题:

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

第9题:

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

第10题:

You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()

  • A、The method must return a type of either IEnumerator or IEnumerable.
  • B、The method must return a type of IComparable.
  • C、The method must explicitly contain a collection.
  • D、The method must be the only iterator in the class.

正确答案:A

更多相关问题