You are developing a method to hash data with the Secure Hash 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 SHA1.
You also need to place the result into a byte array named hash. Which code segment should you use?
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?
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?
You are developing an application for a client residing in Hong Kong. You need to display negative currency values by using a minus sign.
Which code segment should you use?
You are developing an application that will perform mathematical calculations. You need to ensure that the application is able to perform multiple calculations simultaneously. What should you do?
You are creating an assembly named Assembly1. Assembly1 contains a public method. The global cache contains a second assembly named Assembly2. You must ensure that the public method is only called from
Assembly2. Which permission class should you use?
You are developing an application that dynamically loads assemblies from an application directory.
You need to write a code segment that loads an assembly named Company1.dll into the current application domain.
Which code segment should you use?