1.You use Visual Studio .NET to create a Windows-based data management application named MyApp. You implement the following code segment: Dim oSwitch As New _ TraceSwitch("MySwitch", "My TraceSwitch") Dim oWriter As New _ IO.StreamWriter(IO.File.Open("c:\MyApp.txt", _ IO.FileMode.Append)) Dim oListener As New _ TextWriterTraceListener(oWriter) Trace.Listeners.Add(oListener) Try CustomerUpdate() Catch oEx As Exception Trace.WriteLineIf(oSwitch.TraceError, _ "Error: " & oEx.Message) Finally T Trace.Listeners.Clear() oWriter.Close() oWriter = Nothing End Try You compile a debug version of the application and deploy it to a user's computer. The user reports errors, which are generated within the CustomerUpdate procedure. You decide to enable logging of the error messages generated by CustomerUpdate. You want to use the minimum amount of administrative effort. What should you do? A: Start the application with the following command line: /TRACE MySwitch 1.B: Start the application with the following command line: /d:TRACE=True.C: Start the application with the following command line: /XML <switch="MySwitch" value="1">D: Create an environment variable on the user's computer. Name the variable MySwitch and assign it a value of 1.E: Edit your application's .config file to set the value of MySwitch to 1.Correct Answers: E 2.You develop a Windows-based application named CustOrders. You implement the Trace object within your application code. You will use this object to record application information, such as errors and performance data, in a log file. You must have the ability to enable and disable Trace logging. This functionality must involve the minimum amount of administrative effort. What should you do? A: Create a Boolean constant in your application named TraceLogging and set it to False . Each time your code uses Trace logging, use a If Then statement to evaluate your #TraceLogging constant.B: On each computer that will host your application, create an environment variable named CustOrders.Trace. Set the environment variable to True when you want to enable Trace logging. Set it to False when you want to disable Trace logging.C: On each computer that will host your application, edit the shortcut used to start your application. Add /d:TRACE=True to the Target property.D: Use the TraceSwitch class within your code. Each time your code uses Trace logging, consult the TraceSwitch level to verify whether to log information. Change the TraceSwitch level by editing your application's .config file.Correct Answers: D 3.You use Visual Studio .NET to develop a Windows-based application named PatTrac. It uses the security class libraries of the .NET Framework to implement security. PatTrac will run within the context of a Windows 2000 domain named MedicalOffice. Calls to a remote Windows 2000 domain named Hospital will occur during the execution of PatTrac. You want PatTrac to log on to the Hospital domain by using a generic user account. What should you do? A: Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the GenericIdentity object and passing the token of the user whom you want to impersonate.B: Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the WindowsIdentity object and passing the token of the user whom you want to impersonate.C: Create a new instance of the ZoneIdentityPermission class by calling the Impersonate method of the GenericPrincipal object and passing the token of the user whom you want to impersonate.D: Create a new instance of the ZoneIdentityPermission class by calling the Impersonate method of the WindowsPrincipal object and passing the token of the user whom you want to impersonate.Correct Answers: B 4.Another developer in your company uses Visual Studio .NET to create a component named MyComponent. You deploy MyComponent to a server. When you execute MyComponent, you receive the following error message: "System.Security.Policy.PolicyException: Failed to acquire required permissions." As quickly as possible, you need to discover which permissions are required by MyComponent. What should you do? A: Request the source code from the developer who created MyComponent. Examine the source code to find the required permissions.B: Run the Microsoft CLR Debugger (DbgCLR.exe) on the server to view the permissions requested by the application at run time.C: Run the Runtime Debugger (Cordbg.exe) on the server to view the permissions requested by the application at run time.D: Run the Permissions View tool (Permview.exe) on the server to view the permissions required by MyComponent.E: Run the MSIL Disassembler (Ildasm.exe) on the server to view permission requests by MyComponent that were denied.Correct Answers: D 5.You develop a Windows-based application that will retrieve employee vacation data and display it in a DataGrid control. The data is managed locally in a DataSet object named employeeDataSet. You need to write code that will enable users to sort the data by department. Which code segment should you use? A: Dim dvDept As New DataView()dvDept.Table = employeeDataSet.Tables(0)dvDept.Sort = "ASC"DataGrid1.DataSource = dvDeptB: Dim dvDept As New DataView()dvDept.Table = employeeDataSet.Tables(0)
本新闻共3页,当前在第1页 1 2 3