微软MCAD 70-310 实战百题
题目内容

You develop a Windows-based application named WinApp that contains a Windows From named Forml. To WinApp, you add a Web reference to an XML Web service named Servicel.Servicel exposes two Web methods named Authenticate and RetrieveData Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates a unique key, stores that key by using the Session object, and returns that key.RetrieveData expects a valid key that has been generated by Authenticate as input before it will return dat

2021-12-25

A.If the key matches the key in the current session, RetrieveData will return data to the customer.You write the following code segment in the Load event handler of Forml(Line numbers are included for reference only)1.Dim servicel As New localhost.Servicel ()2.Dim key As String3.Dim userData As DataSet4.'Insert new code.5.key = servicel.Authenticate(myUser, myPassword)6.userData = servicel.RetrieveData(key)7.dataGridl.DataSource = userDataYou run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.Which code segment should you use?A.servicel.PreAuthenticate = True

B.servicel.InitializeLifetimeService()C . servicel.CookieContainer = New _System.Net.CookieContainer ()D. Dim cookie As New System.Net.Cookie("Key", key)

题目答案

试卷相关题目

最新试卷
热门试卷

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端