1. Question: You need to write a code segment that performs the following tasks:
    Retrieve the name of each paused service.
    Passe the name to the Add method of Collection1.
    Which code segment should you use?

    A
    Dim searcher As ManagementObjectSearcher = _
    New ManagementObjectSearcher( _
    "Select * from Win32_Service where State = 'Paused'") For Each svc As ManagementObject In
    searcher.Get()
    Collection1.Add(svc("DisplayName"))
    Next

    B
    Dim searcher As ManagementObjectSearcher = _
    New ManagementObjectSearcher( _
    "Select * from Win32_Service")
    For Each svc As ManagementObject In searcher.Get()
    If svc("State").ToString() = "'Paused'" Then
    Collection1.Add(svc("DisplayName"))
    End If
    Next

    C
    Dim searcher As New ManagementObjectSearcher()
    searcher.Scope = New ManagementScope("Win32_Service") For Each svc As ManagementObject In searcher.Get()
    If svc("State").ToString() = "Paused" Then
    Collection1.Add(svc("DisplayName"))
    End If
    Next

    D
    Dim searcher As ManagementObjectSearcher = _
    New ManagementObjectSearcher ( _
    "Select * from Win32_Service", "State = 'Paused'")
    For Each svc As ManagementObject In searcher.Get()
    Collection1.Add(svc("DisplayName"))
    Next

    Note: Not available
    1. Report
  2. Question: You create an application to send a message by e-mail. An SMTP server is available on the local subnet. The SMTP server is named smtp.contoso.com.
    To test the application, you use a source address, me@contoso.com, and a target address, you@contoso. com.
    You need to transmit the e-mail message.
    Which code segment should you use?

    A
    Dim MailFrom As New MailAddress("me@contoso.com", "Me") Dim MailTo As New MailAddress ("you@contoso.com", "You") Dim Message As New MailMessage(MailFrom, MailTo)
    Message.Subject = "Greetings"
    Message.Body = "Test"
    Dim objClient As New SmtpClient("smtp.contoso.com")
    objClient.Send(Message)

    B
    Dim MailFrom As New MailAddress("me@contoso.com", "Me") Dim MailTo As New MailAddress ("you@contoso.com", "You") Dim Message As New MailMessage(MailFrom, MailTo)
    Message.Subject = "Greetings"
    Message.Body = "Test"
    Message.Dispose()

    C
    Dim SMTPClient As String = "smtp.contoso.com"
    Dim MailFrom As String = "me@contoso.com"
    Dim MailTo As String = "you@contoso.com"
    Dim Subject As String = "Greetings"
    Dim Body As String = "Test"
    Dim Message As New MailMessage(MailFrom, MailTo, Subject, SMTPClient)

    D
    Dim MailFrom As New MailAddress("me@contoso.com", "Me") Dim MailTo As New MailAddress ("you@contoso.com", "You") Dim Message As New MailMessage(MailFrom, MailTo)
    Message.Subject = "Greetings"
    Message.Body = "Test"
    Dim Info As New SocketInformation
    Dim Client As New Socket(Info)
    Dim Enc As New ASCIIEncoding
    Dim Bytes() As Byte = Enc.GetBytes(Message.ToString) Client.Send(Bytes)

    Note: Not available
    1. Report
  3. Question: You create an application that stores information about your customers who reside in various regions. You are developing internal utilities for this application. You need to gather regional information about your customers in Canada. Which code segment should you use?

    A
    Dim objCulture As New CultureInfo("CA")
    ...

    B
    For Each objCulture As CultureInfo In _
    "A Composite Solution With Just One Click" - Certification Guaranteed 182 Microsoft 70-536 Exam CultureInfo.GetCultures(CultureTypes.SpecificCultures) ...
    Next

    C
    Dim objRegion As New RegionInfo("CA")
    ...

    D
    Dim objRegion As New RegionInfo("")
    If objRegion.Name = "CA" Then
    ...
    End If

    Note: Not available
    1. Report
  4. Question: You need to read the entire contents of a file named Message.txt into a single string variable. Which code segment should you use?

    A
    Dim result As String = string.Empty
    Dim reader As New StreamReader("Message.txt")
    While Not reader.EndOfStream
    result &= reader.ToString()
    End While

    B
    Dim result As String = Nothing
    Dim reader As New StreamReader("Message.txt")
    result = reader.Read().ToString()

    C
    Dim result As String = Nothing
    Dim reader as New StreamReader("Message.txt")
    result = reader.ReadToEnd()

    D
    Dim result as String = Nothing
    Dim reader As New StreamReader("Message.txt")
    result = reader.ReadLine()

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

    A
    Public Class Age
    Implements IComparable
    Public Value As Integer
    Public Function CompareTo(ByVal obj As Object) As Integer _ Implements IComparable.CompareTo
    Try
    Return Value.CompareTo((CType(obj, Age)).Value)
    Catch Return -1
    End Try
    End Function
    End Class

    B
    Public Class Age
    Public Value As Integer
    Public Function CompareTo(ByVal iValue As Integer) As Object Try
    Return Value.CompareTo(iValue)
    Catch
    Throw New ArgumentException ("object not an Age")
    End Try
    End Function
    End Class

    C
    Public Class Age
    Implements IComparable
    Public Value As Integer
    Public Function CompareTo(ByVal obj As Object) As Integer _ Implements IComparable.CompareTo
    If TypeOf obj Is Age Then
    Dim _age As Age = CType(obj, Age)
    Return Value.CompareTo(_age.Value)
    End If
    Throw New ArgumentException("object not an Age")
    End Function
    End Class

    D
    Public Class Age
    Public Value As Integer
    Public Function CompareTo(ByVal obj As Object) As Object If TypeOf obj Is Age Then
    Dim _age As Age = CType(obj, Age)
    Return Value.CompareTo(obj)
    End If
    Throw New ArgumentException("object not an Age")
    End Function
    End Class

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

    A
    Dim objSSL As New SslStream(client.GetStream)
    objSSL.AuthenticateAsServer(certificate, False, _
    SslProtocols.Tls, True)

    B
    Dim objSSL As New SslStream(client.GetStream)
    objSSL.AuthenticateAsServer(certificate, False, _
    SslProtocols.None, True)

    C
    Dim objSSL As New SslStream(client.GetStream)
    objSSL.AuthenticateAsServer(certificate, False, _
    SslProtocols.Ssl3, True)

    D
    Dim objSSL As New SslStream(client.GetStream)
    objSSL.AuthenticateAsServer(certificate, False, _
    SslProtocols.Ssl2, True)

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

    A
    <DllImport("user32", EntryPoint:="MessageBoxA", _
    "A Composite Solution With Just One Click" - Certification Guaranteed 185 Microsoft 70-536 Exam CharSet:=CharSet.Ansi)> _
    Public Function MessageBox(ByVal hWnd As Int32, _
    <MarshalAs(UnmanagedType.LPWStr)> ByVal text As String, _ <MarshalAs(UnmanagedType.LPWStr) > ByVal caption As String, _ ByVal t As UInt32) As Boolean
    End Function

    B
    DllImport("user32", EntryPoint:="MessageBoxA", _
    CharSet:=CharSet.Unicode)> _
    Public Function MessageBox(ByVal hWnd As Int32, _
    <MarshalAs(UnmanagedType.LPWStr)>
    ByVal text As String, _ <MarshalAs(UnmanagedType.LPWStr) >
    ByVal caption As String, _ ByVal t As UInt32) As Boolean
    End Function

    C
    <DllImport("user32", CharSet:=CharSet.Unicode)> _
    Public Function MessageBox(ByVal hWnd As Int32, _ ByVal text As String,
    ByVal caption As String, _ ByVal t As UInt32) As Boolean
    End Function

    D
    <DllImport("user32", CharSet:=CharSet.Ansi)> _
    Public Function MessageBox(ByVal hWnd As Int32, _
    ByVal text As String, ByVal caption As String, _
    ByVal t As UInt32) As Boolean
    End Function

    Note: Not available
    1. Report
  8. Question: You need to serialize an object of type List(Of Integer) in a binary format. The object is named data. Which code segment should you use?

    A
    Dim formatter As New BinaryFormatter()
    Dim ms As New MemoryStream()
    formatter.Serialize(ms, data)

    B
    Dim formatter As New BinaryFormatter()
    Dim ms As New MemoryStream()
    For i As Integer = 1 To 20
    formatter.Serialize(ms, data(i - 1))
    Next

    C
    Dim formatter As New BinaryFormatter()
    Dim ms As New MemoryStream()
    While ms.CanRead
    formatter.Serialize(ms, data)
    "A Composite Solution With Just One Click" - Certification Guaranteed 186 Microsoft 70-536 Exam
    End While

    D
    Dim formatter As New BinaryFormatter()
    Dim buffer As New Byte(data.Count) {}
    Dim ms As New MemoryStream(buffer, True)
    formatter.Serialize(ms, data)

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

    A
    Dim objDES As New TripleDESCryptoServiceProvider
    Dim objCrypto As ICryptoTransform = _
    objDES.CreateDecryptor()
    Dim cipherStream As New MemoryStream(cipherMessage)
    Dim cryptoStream As New CryptoStream( _
    cipherStream, objCrypto, CryptoStreamMode.Read)
    Dim message As String
    message = New StreamReader(cryptoStream).ReadToEnd

    B
    Dim objDES As New TripleDESCryptoServiceProvider
    objDES.FeedbackSize = cipherMessage.Length
    Dim objCrypto As ICryptoTransform = _
    objDES.CreateDecryptor(key, iv)
    Dim cipherStream As New MemoryStream(cipherMessage)
    Dim cryptoStream As New CryptoStream( _
    cipherStream, objCrypto, CryptoStreamMode.Read)
    Dim message As String
    message = New StreamReader(cryptoStream).ReadToEnd

    C
    Dim objDES As New TripleDESCryptoServiceProvider
    Dim objCrypto As ICryptoTransform = _
    "A Composite Solution With Just One Click" - Certification Guaranteed 187 Microsoft 70-536 Exam objDES.CreateDecryptor(key, iv)
    Dim cipherStream As New MemoryStream(cipherMessage)
    Dim cryptoStream As New CryptoStream( _
    cipherStream, objCrypto, CryptoStreamMode.Read)
    Dim message As String
    message = New StreamReader(cryptoStream).ReadToEnd

    D
    Dim objDES As New TripleDESCryptoServiceProvider
    objDES.BlockSize = cipherMessage.Length
    Dim objCrypto As ICryptoTransform = _
    objDES.CreateDecryptor(key, iv)
    Dim cipherStream As New MemoryStream(cipherMessage)
    Dim cryptoStream As New CryptoStream( _
    cipherStream, objCrypto, CryptoStreamMode.Read)
    Dim message As String
    message = New StreamReader(cryptoStream).ReadToEnd

    Note: Not available
    1. Report
  10. Question: 

    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.

    <Department>

    <name>Hardware</name>

    <manager>Amy</manager>

    </Department>

    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?

    A
    Public Class deptElement
    Inherits ConfigurationElement

    Protected Overrides Sub DeserializeElement( _
    ByVal reader As XmlReader, _
    ByVal serializeCollectionKey As Boolean)
    Dim dept As Department = New Department()
    dept.name = reader.GetAttribute("name")
    dept.manager = reader.GetAttribute("manager")
    End Sub
    End Class

    B
    Public Class deptHandler
    Implements IConfigurationSectionHandler
    Public Function Create(ByVal parent As Object, _
    ByVal configContext As Object, _
    ByVal section As System.Xml.XmlNode) As Object _
    Implements IConfigurationSectionHandler.Create

    Dim dept As Department = new Department()
    dept.name = section.Attributes("name").Value
    dept.manager = section.Attributes("manager").Value
    Return dept
    End Function
    End Class

    C
    Public Class deptHandler
    Implements IConfigurationSectionHandler
    Public Function Create(ByVal parent As Object, _
    ByVal configContext As Object, _
    ByVal section As System.Xml.XmlNode) As Object _
    Implements IConfigurationSectionHandler.Create
    Dim dept As Department = new Department()
    dept.name = section.SelectSingleNode("name").InnerText dept.manager = _ section.SelectSingleNode("manager").InnerTex
    Return dept
    End Function
    End Class

    D
    Public Class deptElement
    Inherits ConfigurationElement
    Protected Overrides Sub DeserializeElement( _
    ByVal reader As XmlReader, _
    ByVal serializeCollectionKey As Boolean)
    Dim dept As Department = New Department(
    ) dept.name = ConfigurationManager.AppSettings("name") "A Composite Solution With Just One Click"-
    Certification Guaranteed 189 Microsoft 70-536 Exam

    dept.manager = _
    ConfigurationManager.AppSettings("manager")
    End Sub
    End Class

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