1.
You are developing a method to hash data for later verification by using the MD5 algorithm. The data is passed to your method as a byte array named message. You need to compute the hash of the incoming parameter by using MD5. You also need to place the result into a byte array. Which code segment should you use?
2.
You need to create a dynamic assembly named MyAssembly. You also need to save the assembly to disk. Which code segment should you use?
3.
You need to call an unmanaged function from your managed code by using platform invoke services. What should you do?
4.
You need to identify a type that meets the following criteria:
5.
You are writing code for user authentication and authorization. The username, password, and roles are stored in your application data store. You need to establish a user security context that will be used for authorization checks such as IsInRole.
You write the following code segment to authorize the user.
if (!TestPassword(userName, password))
throw new Exception(could not authenticate user);
String[] userRolesArray = LookupUserRoles(userName);
You need to complete this code so that it establishes the user security context. Which code segment should you use?
6.
You are developing an application that will perform mathematical calculations. You need to ensure that thapplication is able to perform multiple calculations simultaneously. What should you do?
7.
You develop a service application that needs to be deployed. Your network administrator creates a specific user account for your service application. You need to configure your service application to run in the context of this specific user account. What should you do?
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 rate when an instance of the class is deserialized. Which code segment should you use?
9.
You are writing an application that uses isolated storage to store user preferences. The application uses multiple assemblies. Multiple users will use this application on the same computer. You need to create a directory named Preferences in the isolated storage area that is scoped to the current Microsoft Windows identity and assembly. Which code segment should you use?
10.
Your company uses an application named Application1 that was compiled by using the .NET Framework version 1.0. The application currently runs on a shared computer on which the .NET Framework versions 1.0 and 1.1 are installed. You need to move the application to a new computer on which the .NET Framework versions 1.1 and 2.0 are installed. The application is compatible with the .NET Framework 1.1, but it is incompatible with the .NET Framework 2.0. You need to ensure that the application will use the .NET Framework version 1.1 on the new computer. What should you do?