You are creating a class named Age. You need to ensure that the Age class is written such that collections of Age objects can be sorted. Which code segment should you use?
You are developing a server application that will transmit sensitive information on a network. You create an X509Certificate object named certificate and a TcpClient object named client. You need to create an SslStream to communicate by using the Transport Layer Security 1.0 protocol. Which code segment should you use?
You write the following code segment to call a function from the Win32 Application Programming Interface
(API) by using platform invoke.
Dim PersonName as String = "N?el"
Dim Msg as String = "Welcome " + PersonName + " to club ''!"
Dim r As Boolean= User32API.MessageBox(0, Msg, PersonName, 0)
You need to define a method prototype that can best marshal the string data.
Which code segment should you use?
You are developing a method to decrypt data that was encrypted with the Triple DES Algorithm.
The method accepts the following parameters:
The byte array to be decrypted, which is named cipherMessage
The key, which is named key
An initialization vector, which is named iv
You need to decrypt the message by using the TripleDES class and place the result in a string.
Which code segment should you use?
You create a class library that is used by applications in three departments of your company. The library contains a Department class with the following definition.
Public Class Department
Public name As String
Public manager As String
End Class
Each application uses a custom configuration section to store department-specific values in the application configuration file as shown in the following code. Hardware Amy
You need to write a code segment that creates a Department object instance by using the field values retrieved from the application configuration file.
Which code segment should you use?
You are creating a new security policy for an application domain. You write the following lines of code.
Dim objPolicy As PolicyLevel = PolicyLevel.CreateAppDomainLevel
Dim noTrustStatement As New PolicyStatement( _
objPolicy.GetNamedPermissionSet("Nothing"))
Dim fullTrustStatement As New PolicyStatement( _
objPolicy.GetNamedPermissionSet("FullTrust"))
You need to arrange code groups for the policy so that loaded assemblies default to the Nothing permission set. If the assembly originates from a trusted zone, the security policy must grant the assembly the FullTrust permission set.
Which code segment should you use?
You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use?
You write the following class. Public Class HomePage Public CurrentHeadlines As StringBuilder Private
WelcomeMessage As String Dim Stocktickers As Array Dim PriorityList As Dictionary(Of Int32, String) End
Class You need to generate a type library for this class. The type library will be used by unmanaged code.
Which member should you update?