1. Question: You have recently created a serializable class named Vehicle.
    The class is shown below:
    <Serializable> _
    Public Class Vehicle
    Public VIN As String
    Public Make As String
    Private Model As String
    Private Year As Integer
    Private Owner As String
    End Class
    Certkiller .com does not want the Owner field to be persisted when a Vehicle object is serialized,
    for
    security reasons.
    You need to ensure that this objective is fulfilled.
    What should you do?

    A
    Apply the OptionalField attribute to the Owner field.

    B
    Apply the NonSerialized attribute to the Owner field.

    C
    Have the Vehicle class implement the IFormatter interface for custom serialization.

    D
    Do nothing because, when using binary serialization, Private fields are never persisted.

    Note: Not available
    1. Report
  2. Question: You have recently written the code shown below:
    Dim emailAddresses As New Hashtable()
    emailAddresses.Add("Mia", "mia@ Certkiller .com")
    emailAddresses.Add("Andy", "andy@ Certkiller .com")
    emailAddresses.Add("Kara", "kara@ Certkiller .com")
    Dim stream As New FileStream("Email.dat", FileMode.Create)
    Dim formatter As New BinaryFormatter()
    formatter.Serialize(stream, emailAddresses)
    You need to ensure that you are able to load the emailAddresses object from the Email.dat file
    into your
    application.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Dim readStream As New FileStream("Email.dat", FileMode.Open)
    Dim loadEmails As HashTable = readStream.Deserialize()

    B
    Use the following code:
    Dim readStream As New FileStream("Email.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim loadEmails As HashTable = readFormatter.Deserialize(readStream)

    C
    Use the following code:
    Dim readStream As New FileStream("Email.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim loadEmails As HashTable = DirectCast(readFormatter.Deserialize(readStream),
    HashTable)

    D
    Use the following code:
    Dim readStream As New FileStream("Email.dat", FileMode.Open)
    Dim loadEmails As HashTable = DirectCast(readFormatter.ReadObject(), HashTable)

    Note: Not available
    1. Report
  3. Question: you have recently written the code shown below:
    Dim emailAddresses As New Hashtable()
    emailAddresses.Add("Mia", "mia@ Certkiller .com")
    emailAddresses.Add("Andy", "andy@ Certkiller .com")
    emailAddresses.Add("Kara", "kara@ Certkiller .com")
    You need to ensure that these e-mail addresses are stored in the Email.dat file so that you can
    load them
    again
    when the user restarts the application.
    What should you do? - (VB.NET)

    A
    Add the following code:
    Dim stream As New FileStream("Email.dat", FileMode.Create)
    Dim formatter As New BinaryFormatter()
    formatter.Deserialize(stream, emailAddresses)

    B
    Add the following code:
    Dim stream As New FileStream("Email.dat", FileMode.Create)
    Dim formatter As New BinaryFormatter()
    formatter.Serialize(stream, emailAddresses)

    C
    Add the following code:
    Dim stream As New FileStream("Email.dat", FileMode.Create)
    stream.Serialize(emailAddresses)

    D
    Add the following code:
    Dim stream As New FileStream("Email.dat", FileMode.Create)
    stream.WriteObject(emailAddresses)

    Note: Not available
    1. Report
  4. Question: You have recently completely creating a new application for Certkiller .com.
    This new application has to load an instance of the Inventory class from a large file named
    Inventory.dat.
    You need to ensure that the application executes the loading process in as little time as
    possible.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Dim readStream As New FileStream("Inventory.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim currentInventory As Inventory = DirectCast(readFormatter.FastDeserialize(readStream),
    Inventory)

    B
    Use the following code:
    Dim readStream As New FileStream("Inventory.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim currentInventory As Inventory = DirectCast(readFormatter.Deserialize(readStream),
    Inventory)

    C
    Use the following code:
    Dim readStream As New FileStream("Inventory.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim currentInventory As Inventory = DirectCast(readFormatter.UnsafeDeserialize(readStream),
    Inventory)

    D
    Use the following code:
    Dim readStream As New FileStream("Inventory.dat", FileMode.Open)
    Dim readFormatter As New BinaryFormatter()
    Dim currentInventory As Inventory = DirectCast(readFormatter.SafeDeserialize(readStream),
    Inventory)

    Note: Not available
    1. Report
  5. Question: Certkiller .com has asked you to develop an application that displays the properties for all
    Certkiller.com's
    network drives.
    The information generated by this application will be utilized by Certkiller .com's network
    administrators to
    verify client setups.
    You need to ensure that these requirements are fully satisfied.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Public Sub EnumerateNetworkDrives()
    For Each netDrive As Drive In Drive.GetDrives()
    If netDrive.DriveType = DriveType.Network Then
    Console.WriteLine("{0} ({1}) : {2} bytes", netDrive.Name, netDrive.VolumeLabel, netDrive.
    TotalSize)
    End If
    Next
    End Sub

    B
    Use the following code:
    Public Sub EnumerateNetworkDrives()
    For Each netDrive As DriveInfo In DriveInfo.GetDrives()
    Console.WriteLine("{0} ({1}) : {2} bytes", netDrive.Name, netDrive.VolumeLabel, netDrive.
    TotalSize)
    Next
    End Sub

    C
    Use the following code:
    Public Sub EnumerateNetworkDrives()
    For Each netDrive As DriveInfo In DriveInfo.GetDrives()
    If netDrive.DriveType = DriveType.Network Then
    Console.WriteLine("{0} ({1}) : {2} bytes", netDrive.Name, netDrive.VolumeLabel, netDrive.
    TotalSize)
    End If
    Next
    End Sub

    D
    Use the following code:
    Public Sub EnumerateNetworkDrives()
    For Each netDrive As DriveInfo In DriveInfo.GetDrives(DriveType.Network)
    Console.WriteLine("{0} ({1}) : {2} bytes", netDrive.Name, netDrive.VolumeLabel, netDrive.
    TotalSize)
    Next
    End Sub

    Note: Not available
    1. Report
  6. Question: Certkiller.com has asked you to create an application to display all of the top directories based
    on the drive
    path.
    You need to ensure that the application displays the number of files within top-level directories.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Public Sub DisplayDriveDirectories(drivePath As String)
    If Directory.Exists(drivePath) Then
    For Each dirPath As [String] In Directory.GetDirctories(drivePath)
    Dim dir As New DirectoryInfo(drivePath)
    Dim numFiles As Integer = dir.TotalFiles
    Console.WriteLine("{0} : {1} files.", dir.Name, numFiles)
    Next
    End If
    End Sub

    B
    Use the following code:
    Public Sub DisplayDriveDirectories(drivePath As String)
    If Directory.Exists(drivePath) Then
    For Each dirPath As [String] In Directory.GetDirctories(drivePath)
    Dim dir As New DirectoryInfo(drivePath)
    Dim numFiles As Integer = dir.Length
    Console.WriteLine("{0} : {1} files.", dir.Name, numFiles)
    Next
    End If
    End Sub

    C
    Use the following code:
    Public Sub DisplayDriveDirectories(drivePath As String)
    If Directory.Exists(drivePath) Then
    For Each dirPath As [String] In Directory.GetDirctories(drivePath)
    Dim dir As New DirectoryInfo(drivePath)
    Dim numFiles As Integer = dir.GetFiles().Length
    Console.WriteLine("{0} : {1} files.", dir.Name, numFiles)
    Next
    End If
    End Sub

    D
    Use the following code:
    Public Sub DisplayDriveDirectories(drivePath As String)
    If Directory.Exists(drivePath) Then
    For Each dirPath As [String] In Directory.GetDirctories(drivePath)
    Dim dir As New DirectoryInfo(drivePath)
    Dim numFiles As Integer = dir.Size
    Console.WriteLine("{0} : {1} files.", dir.Name, numFiles)
    Next
    End If
    End Sub

    Note: Not available
    1. Report
  7. Question: Certkiller .com has asked you to create a file management application to monitor the hosts file.
    Certkiller .com has instructed you to change the hosts file if it has been changed.
    You, therefore, need to display the size and whether the hosts file is set to read-only.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Dim hosts As New FileInfo("C:\Windows\system32\drivers\etc\hosts")
    Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
    Console.WriteLine("Size?" + hosts.Length)

    B
    Use the following code:
    Dim hosts As New File("C:\Windows\system32\drivers\etc\hosts")
    Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
    Console.WriteLine("Size?" + hosts.Length)

    C
    Use the following code:
    Dim hosts As New File("C:\Windows\system32\drivers\etc\hosts")
    Console.WriteLine("ReadOnly?" + hosts.GetReadOnly)
    Console.WriteLine("Size?" + hosts.GetLength)

    D
    Use the following code:
    Dim hosts As New FileInfo("C:\Windows\system32\drivers\etc\hosts")
    Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
    Console.WriteLine("Size?" + hosts.Size)

    Note: Not available
    1. Report
  8. Question: You have recently completed the creation of a new application.
    Certkiller .com requires you to ensure that this new application creates a file that contains an
    array of bytes.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Public Sub WriteBytes(bytes As Byte())
    Dim fs As New FileStream("C:\file.txt", FileMode.Create)
    For i As Integer = 0 To bytes.Length - 2
    fs.Write(bytes(i))
    Next
    fs.Close()
    End Sub

    B
    Use the following code:
    Public Sub WriteBytes(bytes As Byte())
    Dim fs As New FileStream("C:\file.txt", FileMode.Create)
    For i As Integer = 0 To bytes.Length - 2
    fs.WriteByte(bytes(i))
    Next
    fs.Close()
    End Sub

    C
    Use the following code:
    Public Sub WriteBytes(bytes As Byte())
    Dim fs As New FileStream("C:\file.txt", FileMode.Create)
    fs.WriteByte(bytes, 0, bytes.Length)
    fs.Close()
    End Sub

    D
    Use the following code:
    Public Sub WriteBytes(bytes As Byte())
    Dim fs As New FileStream("C:\file.txt", FileMode.Create)
    fs.Write(bytes, 0, bytes.Length)
    fs.Close()
    End Sub

    Note: Not available
    1. Report
  9. Question: You are currently in the process of creating an application that reads binary information from a
    file.
    You need to ensure that the only the first kilobyte of data is retrieved.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim bs As New BufferedStream(fs)
    Dim bytes As Byte() = New Byte(1022) {}
    bs.Read(bytes, 0, bytes.Length)
    bs.Close()
    For i As Integer = 0 To bytes.Length - 2
    Console.WriteLine("{0} : {1}", I, bytes(i__1))
    Next

    B
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim bytes As Byte() = New Byte(1022) {}
    fs.Read(bytes, 0, bytes.Length)
    fs.Close()
    For i As Integer = 0 To bytes.Length - 2
    Console.WriteLine("{0} : {1}", I, bytes(i__1))
    Next

    C
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim bs As New BufferedStream(fs)
    Dim bytes As Byte() = New Byte(1022) {}
    bytes = bs.ReadAllBytes(0, 1023)
    bs.Close()
    For i As Integer = 0 To bytes.Length - 2
    Console.WriteLine("{0} : {1}", I, bytes(i__1))
    Next

    D
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim bs As New BufferedStream(fs)
    Dim bytes As Byte() = New Byte(1022) {}
    bs.Read(bytes)
    bs.Close()
    For i As Integer = 0 To bytes.Length - 2
    Console.WriteLine("{0} : {1}", I, bytes(i__1))
    Next

    Note: Not available
    1. Report
  10. Question: You are in the process of creating a new application.
    This new application has to be able to read all data from a text file.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim sr As New StreamReader(fs)
    Dim data As String = sr.ReadToEnd()
    sr.Close()
    Console.WriteLine(data)

    B
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim data As String = sr.ReadToEnd()
    fs.Close()
    Console.WriteLine(data)

    C
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim data As New StringBuilder()
    Dim data As String
    While sr.Peek() > -1
    data += sr.ReadLine()
    End While
    sr.Close()
    Console.WriteLine(data)

    D
    Use the following code:
    Dim fs As New FileStream("C:\file.txt", FileMode.Open)
    Dim sr As New StreamReader(fs)
    Dim data As New StringBuilder()
    While sr.Peek() > -1
    data.Append(sr.ReadLine())
    End While
    sr.Close()
    Console.WriteLine(data.ToString())

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