1. Question: 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?

    A
    Dim objSHA As New SHA1CryptoServiceProvider
    Dim hash() As Byte = objSHA.ComputeHash(message)

    B
    Dim objSHA As New SHA1CryptoServiceProvider
    Dim hash() As Byte = Nothing
    objSHA.TransformBlock(message, 0, message.Length, hash, 0)

    C
    Dim objSHA As New SHA1CryptoServiceProvider
    Dim hash() As Byte = BitConverter.GetBytes(objSHA.GetHashCode)

    D
    Dim objSHA As New SHA1CryptoServiceProvider
    objSHA.GetHashCode()
    Dim hash() As Byte = objSHA.Hash

    Note: Not available
    1. Report
  2. Question: You are developing an application that uses role-based security. The
    principal policy of the application domain is configured during startup
    with the following code. AppDomain.CurrentDomain.SetPrincipalPolicy(
    _ PrincipalPolicy.WindowsPrincipal) You need to restrict access to
    one of the methods in your application so that only members of the
    local Administrators group can call the method. Which attribute
    should you place on the method?

    A
    <PrincipalPermission _ (SecurityAction.Demand, Name:= "BUILTIN\Administrators") _ >

    B
    <PrincipalPermission _ (SecurityAction.Demand, Role:= "BUILTIN\Administrators") _ >
    "A Composite Solution With Just One Click" - Certification Guaranteed 156 Microsoft 70-536 Exam

    C
    <PrincipalPermission _ (SecurityAction.Assert, Role:= "Administrators") _ >

    D
    <PrincipalPermission _ (SecurityAction.Assert, Name:= "Administrators") _ >

    Note: Not available
    1. Report
  3. Question: You are developing a method to call a COM component. You need to use declarative security to explicitly request the runtime to perform a full stack walk. You must ensure that all callers have the required level of trust for COM interop before the callers execute your method. Which attribute should you place on the method?

    A
    <SecurityPermission( _
    SecurityAction.Assert, _
    Flags:=SecurityPermissionFlag.UnmanagedCode) _ >

    B
    <SecurityPermission( _
    SecurityAction.Demand, _
    Flags:=SecurityPermissionFlag.UnmanagedCode) _
    >

    C
    <SecurityPermission( _
    SecurityAction.LinkDemand, _
    Flags:=SecurityPermissionFlag.UnmanagedCode) _
    >

    D
    <SecurityPermission( _
    SecurityAction.Deny, _
    Flags:=SecurityPermissionFlag.UnmanagedCode) _
    >

    Note: Not available
    1. Report
  4. Question: 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?

    A
    Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5") Dim hash() As Byte = BitConverter. GetBytes(objAlgo.GetHashCode)

    B
    Dim objAlgo As HashAlgorithm
    objAlgo = HashAlgorithm.Create(message.ToString)
    Dim hash() As Byte = objAlgo.Hash

    C
    Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5") Dim hash() As Byte = objAlgo. ComputeHash(message)

    D
    Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5") Dim hash() As Byte objAlgo.TransformBlock(message, 0, message.Length, hash, 0)

    Note: Not available
    1. Report
  5. Question: You are developing a utility screen for a new client application. The utility screen displays a thermometer that conveys the current status of processes being carried out by the application. You need to draw a rectangle on the screen to serve as the background of the thermometer as shown in the exhibit.The rectangle must be filled with gradient shading. (Click the Exhibit button.) Which code segment should you choose?

    A
    Dim objRect As New Rectangle(10, 10, 450, 25)
    Dim objBrush As New SolidBrush(Color.AliceBlue)
    Dim objPen As New Pen(objBrush)
    Dim g As Graphics = myForm.CreateGraphics

    B
    DrawRectangle(objPen, objRect)

    C
    Dim objRect As New RectangleF(10.0F, 10.0F, 450.0F, 25.0F) Dim points() As System.Drawing.Point = _
    {New Point(0, 0), New Point(110, 145)}
    Dim objBrush As New LinearGradientBrush( _
    objRect, Color.AliceBlue, Color.CornflowerBlue, _
    LinearGradientMode.ForwardDiagonal)
    Dim objPen As New Pen(objBrush)
    Dim g As Graphics = myForm.CreateGraphics

    D
    DrawPolygon(objPen, points)

    E
    Dim objRect As New Rectangle(10, 10, 450, 25)
    Dim objBrush As New LinearGradientBrush( _
    objRect, Color.AliceBlue, Color.CornflowerBlue, _
    LinearGradientMode.ForwardDiagonal)
    Dim objPen As New Pen(objBrush)
    Dim g As Graphics = myForm.CreateGraphics

    F
    FillDrawRectangle(objPen, objRect)

    G
    Dim objRect As New Rectangle(10, 10, 450, 25)
    Dim objBrush As New LinearGradientBrush( _
    objRect, Color.AliceBlue, Color.CornflowerBlue, _
    LinearGradientMode.ForwardDiagonal)
    Dim objPen As New Pen(objBrush)
    Dim g As Graphics = myForm.CreateGraphics

    H
    FillRectangle(objBrush, objRect)

    Note: Not available
    1. Report
  6. Question: You are developing a method that searches a string for a substring. The method will be localized to Italy.
    Your method accepts the following parameters:
    The string to be searched, which is named SearchList
    The string for which to search, which is named SearchValue
    You need to write the code.
    Which code segment should you use?

    A
    Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfo
    Return objComparer.Compare(SearchList, SearchValue)

    B
    Return SearchList.IndexOf(SearchValue)

    C
    Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfo
    If objComparer.IndexOf(SearchList, SearchValue) > 0 Then Return True
    Else
    Return False
    End If

    D
    Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfo
    If SearchList.IndexOf(SearchValue) > 0 Then
    Return True
    Else
    Return False
    End If

    Note: Not available
    1. Report
  7. Question: 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?

    A
    Dim objCulture As NumberFormatInfo = _
    New CultureInfo("zh-HK").NumberFormat
    objCulture.NumberNegativePattern = 1
    Return NumberToPrint.ToString("C", objCulture)

    B
    Dim objCulture As NumberFormatInfo = _
    New CultureInfo("zh-HK").NumberFormat
    Return NumberToPrint.ToString("-{0}", objCulture)

    C
    Dim objCulture As NumberFormatInfo = _
    New CultureInfo("zh-HK").NumberFormat
    Return NumberToPrint.ToString("()", objCulture)

    D
    Dim objCulture As NumberFormatInfo = _
    New CultureInfo("zh-HK").NumberFormat
    objCulture.CurrencyNegativePattern = 1
    Return NumberToPrint.ToString("C", objCulture)

    Note: Not available
    1. Report
  8. Question: You need to generate a report that lists language codes and region codes. Which code segment should you use?

    A
    For Each objCulture As CultureInfo In _ CultureInfo.GetCultures(CultureTypes.NeutralCultures) ... Next

    B
    For Each objCulture As CultureInfo In _ CultureInfo.GetCultures(CultureTypes.SpecificCultures) ... Next

    C
    Dim objCulture As New CultureInfo("")
    Dim objTypes As CultureTypes = objCulture.CultureTypes ...

    D
    For Each objCulture As CultureInfo In _
    CultureInfo.GetCultures(CultureTypes.ReplacementCultures) ...
    Next

    Note: Not available
    1. Report
  9. Question: You need to select a class that is optimized for key-based item retrieval from both small and large collections. Which class should you choose?

    A
    ListDictionary class

    B
    HybridDictionary class

    C
    Hashtable class

    D
    OrderedDictionary class


    Note: Not available
    1. Report
  10. Question: You are creating a class named Temperature. The Temperature class
    contains a public field named F. The public field F represents a
    temperature in degrees Fahrenheit. You need to ensure that users can
    specify whether a string representation of a Temperature instance
    displays the Fahrenheit value or the equivalent Celsius value. Which
    code segment should you use?

    A
    Public Class Temperature
    Implements IFormattable
    Public F As Integer
    Public Function ToString ( ByVal format As String, _ ByVal fp As IFormatProvider ) As String _
    Implements IFormattable.ToString If (format = "F" Or format = Nothing) Then
    Return F.ToString ()
    End If
    If format = "C" Then
    Return ((F - 32) / 1.8). ToString ()
    End If
    Throw New FormatException ("Invalid format string")
    End Function End Class

    B
    Public Class Temperature
    Implements ICustomFormatter
    Public F As Integer
    Public Function Format( ByVal formatString As String, _ ByVal arg as object, ByVal fp As
     IFormatProvider ) _ As String Implements ICustomFormatter.Format
    If formatString = "C" Then
    Return ((F - 32) / 1.8). ToString ()
    End If
    If formatString = "F" Then Return arg.ToString ()
    End If
    Throw New FormatException ("Invalid format string")
    End Function
    End Class

    C
    Public Class Temperature Public F As Integer Public Function ToString ( ByVal format As String, _
    ByVal fp As IFormatProvider ) As String If format = "C" Then Return ((F - 32) / 1.8). ToString ()
    Else
    Return Me.GetType (). ToString ()
    End If
    End Function End Class

    D
    Public Class Temperature
    Public F As Integer
    Protected format As String Public Overrides Function ToString () As String
    If format = "C" Then
    Return ((F - 32) / 1.8). ToString ()
    End If
    Return F.ToString ()
    End Function End Class

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd