1. Question: You work as an application developer at Certkiller .com. You are currently in the process of
    creating a new
    application for Certkiller .com. You are required to read compressed data files that has been
    sent by
    Certkiller .com's sales offices.
    These data files are less than 4 GB in size, but was compressed without cyclic redundancy. You
    want to
    write a method that receives the compressed files and return the uncompressed data as a byte
    array.
    What should you do? - (VB.NET)

    A
    Use the following code:
    Public Function DecompressFile(file As String) As Byte()
    Dim fs As New FileStream(file, FileMode.Open)
    Dim cs As New DeflateStream(fs, CompressionMode.Decompress, True)
    Dim data As Byte() = New Byte(fs.Length - 2) {}
    cs.Read(data, 0, data.Length)
    cs.Close()
    Return data
    End Function

    B
    Use the following code:
    Public Function DecompressFile(file As String) As Byte()
    Dim fs As New FileStream(file, FileMode.Open)
    Dim cs As New GZipStream(fs, CompressionMode.Decompress)
    Dim data As Byte() = New Byte(fs.Length - 2) {}
    cs.Read(data, 0, data.Length)
    Return data
    End Function

    C
    Use the following code:
    Public Function DecompressFile(file As String) As Byte()
    Dim fs As New FileStream(file, FileMode.Open)
    Dim cs As New DeflateStream(fs, CompressionMode.Decompress)
    Dim data As Byte() = New Byte(fs.Length - 2) {}
    cs.Read(data, 0, data.Length)
    Return data
    End Function

    D
    Use the following code:
    Public Function DecompressFile(file As String) As Byte()
    Dim fs As New FileStream(file, FileMode.Open)
    Dim cs As New GZipStream(fs, CompressionMode.Decompress, True)
    Dim data As Byte() = New Byte(fs.Length - 2) {}
    cs.Read(data, 0, data.Length)
    cs.Close()
    Return data
    End Function

    Note: Not available
    1. Report
  2. Question: Certkiller .com has a file server named Certkiller -SR07 that stores old inventory files. Certkiller
    .com has
    given you the task of creating an application to archive these old inventory files.
    The inventory files have to be compressed prior to being uploaded to Certkiller .com's Web
    server.
    You are currently writing a method that will receive a byte array and compress it into a new file.
    You need to ensure that a data corruption check takes place during the decompression process.
    What should you do?

    A
    Use the following code:
    Public Sub CompressFileWrite(file As String, data As Byte())
    Dim fs As New FileStream(file, FileMode.Create)
    Dim cs As New DeflateStream(fs, Compressionmode.Compress, True)
    cs.Write(data, 0, data.Length)
    cs.Close()
    End Sub

    B
    Use the following code:
    Public Sub CompressFileWrite(file As String, data As Byte())
    Dim fs As New FileStream(file, FileMode.Create)
    Dim cs As New GZipStream(fs, Compressionmode.Compress, True)
    cs.Compress(data, 0, data.Length)
    cs.Close()
    End Sub

    C
    Use the following code:
    Public Sub CompressFileWrite(file As String, data As Byte())
    Dim fs As New FileStream(file, FileMode.Create)
    Dim cs As New DeflateStream(fs, Compressionmode.Compress, True)
    cs.Compress(data, 0, data.Length)
    cs.Close()
    End Sub

    D
    Use the following code:
    Public Sub CompressFileWrite(file As String, data As Byte())
    Dim fs As New FileStream(file, FileMode.Create)
    Dim cs As New GZipStream(fs, Compressionmode.Compress, True)
    cs.Write(data, 0, data.Length)
    cs.Close()
    End Sub

    Note: Not available
    1. Report
  3. Question: You define the following regular expression of currency values:
    regex tx = new regex("^-?\d+(\.\d{2})?$")
    You are required to write code that will be used to find whether a string in the variable named
    Bill matches
    the regular expression or not. You are also required to use this code as the expression in a
    conditional
    statement and need to know which code segment to use.
    What should you do? - (VB.NET)

    A
    The tx.Matches(Bill)

    B
    The tx.Equals(Bill)

    C
    The tx.Match(Bill)

    D
    The tx.IsMatch(Bill)

    Note: Not available
    1. Report
  4. Question: You work as the application developer at Certkiller .com.
    Certkiller .com uses Visual Studio.NET 2005 as its application development platform.
    You are developing a .NET Framework 2.0 application that will be used for
    geographical mapping. Whenever you load a plug-in you create a separate application domain.
    You want to specify a list of directories that are searched for private assemblies.
    You are required to add the application's base directory as part of your search and need to
    configure an
    application domain to meet the requirements. - (VB.NET)

    A
    The AppDomainSetup.PrivateBinPathProbe property should be used.

    B
    The AppDomain.BaseDirectory property should be used.

    C
    The AppDomain.DynamicDirectory property should be used.

    D
    The AppDomainSetup.PrivateBinPath property should be used.

    Note: Not available
    1. Report
  5. Question: You need to write a code segment that will add a string named strConn to the connection string section of the application configuration file. Which code segment should you use?

    A
    Dim myConfig As Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)
    myConfig.ConnectionStrings.ConnectionStrings.Add( _
    New ConnectionStringSettings("ConnStr1", strConn))
    myConfig.Save()

    B
    Dim myConfig As Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)
    myConfig.ConnectionStrings.ConnectionStrings.Add( _
    New ConnectionStringSettings("ConnStr1", strConn))
    ConfigurationManager.RefreshSection("ConnectionStrings")

    C
    ConfigurationManager.ConnectionStrings.Add( _
    New ConnectionStringSettings("ConnStr1", strConn))
    ConfigurationManager.RefreshSection("ConnectionStrings")

    D
    ConfigurationManager.ConnectionStrings.Add(
    New ConnectionStringSettings("ConnStr1", strConn))
    Dim myConfig As Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)
    myConfig.Save()

    Note: Not available
    1. Report
  6. Question: You are developing an auditing application to display the trusted ClickOnce applications that are installed on a computer. You need the auditing application to display the origin of each trusted application. Which code segment should you use?

    A
    Dim objTrusts As ApplicationTrustCollection
    objTrusts = ApplicationSecurityManager.UserApplicationTrusts For Each objTrust As ApplicationTrust In
    objTrusts
    Console.WriteLine(objTrust.ToString)
    Next

    B
    Dim objTrusts As ApplicationTrustCollection
    objTrusts = ApplicationSecurityManager.UserApplicationTrusts For Each objTrust As ApplicationTrust In
    objTrusts
    Console.WriteLine(objTrust.ExtraInfo.ToString)
    Next

    C
    Dim objTrusts As ApplicationTrustCollection
    objTrusts = ApplicationSecurityManager.UserApplicationTrusts For Each objTrust As ApplicationTrust In
    objTrusts
    Console.WriteLine(objTrust.ApplicationIdentity.FullName.ToString) Next

    D
    Dim objTrusts As ApplicationTrustCollection
    objTrusts = ApplicationSecurityManager.UserApplicationTrusts For Each objTrust As Object In
    objTrusts
    Console.WriteLine(objTrust.ToString)
    Next

    Note: Not available
    1. Report
  7. Question: You develop an application that appends text to existing text files. You need to write a code segment that enables the application to append text to a file named C:\MyFile.txt. The application must throw an exception if the file does not exist. You need to ensure that the other applications can read but not modify the file. Which code segment should you use?

    A
    Dim fs As New FileStream("C:\MyFile.txt", _
    FileMode.Open, FileAccess.ReadWrite, FileShare.Read)

    B
    Dim fs As New FileStream("C:\MyFile.txt", _
    FileMode.OpenOrCreate, FileAccess.ReadWrite, _
    FileShare.Read)

    C
    Dim fs As New FileStream("C:\MyFile.txt", _
    FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

    D
    Dim fs As New FileStream("C:\MyFile.txt", _
    FileMode.Append, FileAccess.ReadWrite)

    Note: Not available
    1. Report
  8. Question: You need to write a code segment that will create a common language runtime (CLR) unit of isolation within an application. Which code segment should you use?

    A
    Dim domain As AppDomain
    domain = AppDomain.CreateDomain("MyDomain")

    B
    Dim myComponent As System.ComponentModel.Component
     myComponent = New System.ComponentModel.Component()

    C
    Dim mySetup As AppDomainSetup = _
    AppDomain.CurrentDomain.SetupInformation
    mySetup.ShadowCopyFiles = "true"

    D
    Dim myProcess As System.Diagnostics.Process
    myProcess = New System.Diagnostics.Process()

    Note: Not available
    1. Report
  9. Question: You are developing an application to perform mathematical calculations. You develop a class named CalculationValues. You write a procedure named PerformCalculation that operates on an instance of the class.
    You need to ensure that the user interface of the application continues to respond while calculations are being performed. You need to write a code segment that calls the PerformCalculation procedure to achieve this goal.

    Which code segment should you use?

    A
    Private Sub PerformCalculation ( _
    ByVal values As Object)
     ...
    End Sub
    Private Sub DoWork()
    Dim myValues As New CalculationValues()
    Dim newThread As New Thread( _
    New ParameterizedThreadStart( _
    AddressOf PerformCalculation))
    newThread.Start(myValues)
    End Sub

    B
    Private Sub PerformCalculation ( _
    ByVal values As CalculationValues)
    ...
    End Sub
    Private Sub DoWork()
    Dim myValues As New CalculationValues()
    Application.DoEvents()
    PerformCalculation(myValues)
    Application.DoEvents()
    End Sub

    C
    Private Sub PerformCalculation()
    ...
    End Sub
    Private Sub DoWork()
    Dim myValues As New CalculationValues()
    Dim delStart As New ThreadStart( _ AddressOf PerformCalculation)
    Dim newThread As New Thread(delStart) If newThread.IsAlive
    Then newThread.Start(myValues)
    End If
    End Sub

    D
    Private Sub PerformCalculation()
    ...
    End Sub
    Private Sub DoWork()
    Dim myValues As New CalculationValues()
    Dim newThread As New Thread( _
    New ThreadStart(AddressOf PerformCalculation))
    newThread.Start(myValues)
    End Sub

    Note: Not available
    1. Report
  10. Question: You develop a service application named PollingService that periodically calls long-running procedures. These procedures are called from the DoWork method.
    You use the following service application code:
    Partial Class PollingService
    Inherits ServiceBase
    Dim blnExit As Boolean = False
    Protected Overrides Sub OnStart(ByVal args() As String)
    Do
    DoWork()
    Loop While Not blnExit
    End Sub
    Protected Overrides Sub OnStop()
    blnExit = True
    End Sub
    Private Sub DoWork()
    ...
    End Sub
    End Class
    When you attempt to start the service, you receive the following error message: Could not start the PollingService service on the local computer. Error 1053: The service did not respond to the start or control request in a timely fashion.
    You need to modify the service application code so that the service starts properly.
    What should you do?

    A
    Move the loop code into the constructor of the service class from the OnStart method.

    B
    Move the loop code from the OnStart method into the DoWork method.

    C
    Drag a timer component onto the design surface of the service. Move the calls to the long- running procedure from the OnStart method into the Tick event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.

    D
    Add a class-level System.Timers.Timer variable to the service class code. Move the call to the DoWork method into the Elapsed event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.

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