1. Question: What types of objects derive from te MemberInfo class? (Chose all that applay.) -(VB.Net)

    A
    FieldInfo class

    B
    MethodInfo class

    C
    Assembly class

    D
    Type class

    Note: Not available
    1. Report
  2. Question: You are writing an application that communicates with a database. The connection string
    is stored in the application configuration file. Which of the following correctly retrieves the connection
    string? - (VB.Net)

    A
    ConfigurationManager.ConnectionStrings.ConnectionString

    B
    ConfigurationSettings.ConnectionStrings.ConnectionString

    C
    ConfigurationManager.ConnectionStrings(0).ConnectionString

    D
    ConfigurationSettings.ConnectionStrings(0).ConnectionString

    Note: Not available
    1. Report
  3. Question: What values of the assemblyBuilderAccess enumeration allow you to execute the
    assembly? - (VB.Net)

    A
    AssemblyBuilderAccess.Run

    B
    AssemblyBuilderAccess.ReflectionOnly

    C
    AssemblyBuilderAccess.RunAndSave

    D
    AssemblyBuilderAccess.Save

    Note: Not available
    1. Report
  4. Question: You are testing a newly developed method named PersistToDB. This method accepts a
    parameter of type
    EventLogEntry.
    This method does not return a value. You need to create a code segment that helps you to test
    the method.
    The code segment must read entries from the application log of local computers and then pass
    the entries
    on to the PersistToDB method.
    The code block must pass only events of type Error or Warning from the source MySource to
    the
    PersistToDB method.
    Which code segment should you use? - (VB.Net)

    A
    Dim myLog As New EventLog("Application", ".")
    For Each entry As EventLogEntry In myLog.Entries
    If entry.Source = "MySource" Then
    PersistToDB(entry)
    End If
    Next

    B
    Dim myLog As New EventLog("Application", ".")
    myLog.Source = "MySource"
    For Each entry As EventLogEntry In myLog.Entries
    If entry.EntryType = (EventLogEntryType.[Error] And EventLogEntryType.Warning) Then
    PersistToDB(entry)
    End If
    Next

    C
    Dim myLog As New EventLog("Application", ".")
    For Each entry As EventLogEntry In myLog.Entries
    If entry.Source = "MySource" Then
    If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType = EventLogEntryType.
    Warning Then
    PersistToDB(entry)
    End If
    End If
    Next

    D
    Dim myLog As New EventLog("Application", ".")
    myLog.Source = "MySource"
    For Each entry As EventLogEntry In myLog.Entries
    If entry.EntryType = EventLogEntryType.[Error] OrElse entry.EntryType = EventLogEntryType.
    Warning Then
    PersistToDB(entry)
    End If
    Next

    Note: Not available
    1. Report
  5. Question: You need to write a code segment that performs the following tasks: ? Retrieves the name of
    each paused
    service. ?
    Passes the name to the Add method of Collection1.
    Which code segment should you use? - (VB.Net)

    A
    Dim searcher As 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 New ManagementObjectSearcher("Select * from Win32_service", "State =
    'Paused'")
    For Each svc As ManagementObject In searcher.[Get]()
    Collection1.Add(svc("DisplayName"))
    Next

    C
    Dim searcher As New ManagementObjectSearcher("Select * from Win32_service")
    For Each svc As ManagementObject In searcher.[Get]()
    If DirectCast(svc("State"), String) = "'Paused'" Then
    Collection1.Add(svc("DisplayName"))
    End If
    Next

    D
    Dim searcher As New ManagementObjectSearcher()
    searcher.Scope = New ManagementScope("Win32_service")
    For Each svc As ManagementObject In searcher.[Get]()
    If DirectCast(svc("State"), String) = "Paused" Then
    Collection1.Add(svc("DisplayName"))
    End If
    Next

    Note: Not available
    1. Report
  6. Question: You are using the Microsoft Visual Studio 2005 IDE to examine the output of a method that
    returns a string.
    You assign the output of the method to a string variable named fName. You need to write a
    code segment
    that prints the following on a single line The message:
    "Test Failed: "
    The value of fName if the value of fName does not equal "Certkiller" You also need to ensure
    that the code
    segment simultaneously facilitates uninterrupted execution of the application.
    Which code segment should you use? - (VB.Net)

    A
    Debug.Assert(fName = "CertKiller", "Test Failed: ", fName)

    B
    Debug.WriteLineIf(fName <> "CertKiller", fName, "Test Failed: ")

    C
    If fName <> "Certkiller" Then
    Debug.print("Test Failed: ")
    Debug.print(fName)
    End If

    D
    If fName <> "Certkiller" Then
    Debug.WriteLine("Test Failed: ")
    Debug.WriteLine(fName)
    End If

    Note: Not available
    1. Report
  7. Question: You are testing a method that examines a running process.
    This method returns an ArrayList containing the name and full path of all modules that are
    loaded by the
    process.
    You need to list the modules loaded by a process named C:\TestApps\Process1.exe.
    Which code segment should you use? - (VB.Net)

    A
    Dim ar As New ArrayList()
    Dim procs As Process()
    Dim [module] As ProcessModuleCollection
    procs = Process.GetProcesses("Process1")
    If procs.Length > 0 Then
    [module] = procs(0).Modules
    For Each [mod] As ProcessModule In modules
    ar.Add([mod].ModuleName)
    Next
    End If

    B
    Dim ar As New ArrayList()
    Dim procs As Process()
    Dim [module] As ProcessModuleCollection
    procs = Process.GetProcesses("C:\TestApps\Process1.exe")
    If procs.Length > 0 Then
    [module] = procs(0).Modules
    For Each [mod] As ProcessModule In modules
    ar.Add([mod].ModuleName)
    Next
    End If

    C
    Dim ar As New ArrayList()
    Dim procs As Process()
    Dim [module] As ProcessModuleCollection
    procs = Process.GetProcessesByName("Process1")
    If procs.Length > 0 Then
    [module] = procs(0).Modules
    For Each [mod] As ProcessModule In modules
    ar.Add([mod].FileName)
    Next
    End If

    D
    Dim ar As New ArrayList()
    Dim procs As Process()
    Dim [module] As ProcessModuleCollection
    procs = Process.GetProcessesByName("C:\TestApps\Process1.exe")
    If procs.Length > 0 Then
    [module] = procs(0).Modules
    For Each [mod] As ProcessModule In modules
    ar.Add([mod].FileName)
    Next
    End If

    Note: Not available
    1. Report
  8. Question: You have been asked to profile a business application that can be accessible using the Event
    Log API.
    You have started by adding the following code to create a custom event log:
    If EventLog.SourceExists("Application1") Then
    EventLog.DeleteEventSource("Application1")
    End If
    'Create new event log
    EventLog.CreateEventSource("Application1", "Profile")
    You need to write an event to the Application1 event log.
    What code must you use? - (VB.Net)

    A
    Dim log As New EventLog()
    log.Source = "Application1"
    log.Log = "Profile"
    log.WriteEvent("Writing to event log.")

    B
    Dim log As New EventLog()
    log.Source = "Profile"
    log.Log = "Application1"
    log.WriteEvent("Writing to event log.")

    C
    Dim log As New EventLog()
    log.Source = "Application1"
    log.Log = "Profile"
    log.WriteEntry("Writing to event log.")

    D
    Dim log As New EventLog()
    log.Source = "Profile"
    log.Log = "Application1"
    log.WriteEntry("Writing to event log.")

    Note: Not available
    1. Report
  9. Question: The Certkiller .com network contains an application server named Certkiller -SR07.
    You have been asked to profile a business application that can be accessible using the Event
    Log API.
    You want to achieve this by creating a custom event log on Certkiller -SR07.
    What should you do? - (VB.Net)

    A
    Use the following code:
    EventLog.CreateEventSource("Application1", "Profile", "Certkiller -SR07")

    B
    Use the following code:
    EventLog.CreateEventSource("Application1", "Profile")

    C
    Use the following code:
    Dim sourceData As New EventSourceCreationData("Application1", "Profile")
    sourceData.MachineName = "Certkiller -SR07"
    EventLog.CreateEventSource(sourceData)

    D
    Use the following code:
    Dim sourceData As New EventSourceCreationData("Application1", "Profile")
    EventLog.CreateEventSource(sourceData)

    Note: Not available
    1. Report
  10. Question: You are required to retrieve and display the names of all processes that are currently running in
    memory.
    What should you do? - (VB.Net)

    A
    Use the following code:
    For Each curProcess As Process In Process.GetSystemProcesses()
    Console.WriteLine(curProcess.ProcessName)
    Next

    B
    Use the following code:
    For Each curProcess As Process In Process.GetAllProcesses()
    Console.WriteLine(curProcess.ProcessName)
    Next

    C
    Use the following code:
    For Each curProcess As Process In Process.GetProcesses()
    Console.WriteLine(curProcess.ProcessName)
    Next

    D
    Use the following code:
    For Each curProcess As Process In Thread.GetProcesses()
    Console.WriteLine(curProcess.ProcessName)
    Next

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