1. Question: You develop a service application named FileService. You deploy the service application to multiple servers on your network.
    You implement the following code segment. (Line numbers are included for reference only.)
    01 Public Sub StartService(ByVal serverName As String)
    02 Dim crtl As ServiceController = _
    03 New ServiceController("FileService")
    04 If crtl.Status = ServiceControllerStatus.Stopped Then
    05 End If
    06 End Sub
    You need to develop a routine that will start FileService if it stops. The routine must start FileService on the server identified by the serverName input parameter.
    Which two lines of code should you add to the code segment? (Each correct answer presents part of the solution. Choose two.)

    A
    Insert the following line of code between lines 04 and 05:
    crtl.ExecuteCommand(0)

    B
    Insert the following line of code between lines 04 and 05:
    crtl.Continue()

    C
    Insert the following line of code between lines 04 and 05:crtl.Start()

    D
    Insert the following line of code between lines 03 and 04:
    crtl.ServiceName = serverName

    E
    Insert the following line of code between lines 03 and 04:
    crtl.MachineName = serverName

    F
    Insert the following line of code between lines 03 and 04:
    crtl.Site.Name = serverName

    Note: Not available
    1. Report
  2. Question: You are developing an application that will perform mathematical calculations. You need to ensure that the application is able to perform multiple calculations simultaneously. What should you do?

    A
    Set the IdealProcessor property of the ProcessThread object.

    B
    For each calculation, call the QueueUserWorkItem method of the ThreadPool class.

    C
    Set the Process.GetCurrentProcess().BasePriority property to High.

    D
    Set the ProcessorAffinity property of the ProcessThread object.

    Note: Not available
    1. Report
  3. Question: You are writing a method that returns an ArrayList named al. You need to ensure that changes to the ArrayList are performed in a thread-safe manner. Which code segment should you use?

    A
    Dim al As ArrayList = New ArrayList()
    Dim sync_al as ArrayList = ArrayList.Synchronized(al) Return sync_al

    B
    Dim al As ArrayList = New ArrayList()
    SyncLock al.SyncRoot.GetType()
    Return al
    End SyncLock

    C
    Dim al As ArrayList = New ArrayList()
    Monitor.Enter(al)
    Monitor.Exit(al)
    Return al

    D
    Dim al As ArrayList = New ArrayList()
    SyncLock al.SyncRoot
    Return al
    End SyncLock

    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?

    A
    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

    B
    Dim myLog as New EventLog("Application", ".")
    myLog.Source = "MySource"
    For Each entry As EventLogEntry In myLog.Entries
    If (entry.EntryType = EventLogEntryType.Error) Or _
    (entry.EntryType = 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) Or _
    (entry.EntryType = EventLogEntryType.Warning) Then
    PersistToDB(entry)
    End If
    End If
    Next

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

    Note: Not available
    1. Report
  5. Question: You are developing an application that receives events asynchronously. You create a WqlEventQuery instance to specify the events and event conditions to which the application must respond. You also create a ManagementEventWatcher instance to subscribe to events matching the query. You need to identify the other actions you must perform before the application can receive events asynchronously. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

    A
    Create an event handler class that has a method that receives an ObjectReadyEventArgs parameter.

    B
    Set up a listener for events by using the Stopped event of the ManagementEventWatcher.

    C
    Use the WaitForNextEvent method of the ManagementEventWatcher to wait for the events.

    D
    Start listening for events by calling the Start method of the ManagementEventWatcher.

    E
    Set up a listener for events by using the EventArrived event of the ManagementEventWatcher.

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

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

    B
    Dim ar As New ArrayList()
    "A Composite Solution With Just One Click" - Certification Guaranteed 141 Microsoft 70-536 Exam
    Dim procs As Process()
    Dim modules As ProcessModuleCollection
    procs = _
    Process.GetProcessesByName("C:\TestApps\Process1.exe") If procs.Length > 0 Then
    modules = procs(0).Modules
    For Each pm As ProcessModule In Modules
    ar.Add(pm.FileName)
    Next
    End If

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

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

    Note: Not available
    1. Report
  7. Question: You are creating a strong-named assembly named Assembly1 that will be used in multiple applications. Assembly1 will be rebuilt frequently during the development cycle. You need to ensure that each time the assembly is rebuilt it works correctly with each application that uses it. You need to configure the computer on which you develop Assembly1 such that each application uses the latest build of Assembly1. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

    A
    Create a DEVPATH environment variable that points to the build output directory for the strong- named assembly.

    B
    Add the following XML element to the machine configuration file: <dependentAssembly>
    <assemblyIdentity name="Assembly1"
    publicKeyToken="32ab4ba45e0a69a1"
     language="en-US" version="*.*.*.*" />
    <publisherPolicy apply="no" />
    </dependentAssembly>

    C
    Add the following XML element to the configuration file of each application that uses the strong- named assembly:
    <supportedRuntime version="*.*.*.*" />

    D
    Add the following XML element to the machine configuration file:
    <developmentMode developerInstallation="true"/>

    E
    Add the following XML element to the configuration file of each application that uses the strong- named assembly:

    <dependentAssembly>
    <assemblyIdentity name="Assembly1"
    publicKeyToken="32ab4ba45e0a69a1"
     language="en-US" version="*.*.*.*" />
    <bindingRedirect newVersion="*.*.*.*"/>
    </dependentAssembly>


    Note: Not available
    1. Report
  8. Question: You are using the Microsoft Visual Studio 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 "John"
    You also need to ensure that the code segment simultaneously facilitates uninterrupted execution of the application. Which code segment should you use?

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

    B
    Debug.WriteLineIf(fName < > "John", _ fName, "Test Failed")

    C
    If fName < > "John" Then Debug.Print("Test Failed: ") Debug.Print(fName) End If

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

    Note: Not available
    1. Report
  9. Question: Your company uses an application named Application1 that was compiled by using the .NET Framework version 1.0. The application currently runs on a shared computer on which the .NET Framework versions 1.0 and 1.1 are installed.
    You need to move the application to a new computer on which the .NET Framework versions 1.1 and 2.0 are installed. The application is compatible with the .NET Framework 1.1, but it is incompatible with the . NET Framework 2.0.
    You need to ensure that the application will use the .NET Framework version 1.1 on the new computer.
    What should you do?

    A
    Add the following XML element to the machine configuration file.
    <configuration>
    <runtime>
    <assemblyBinding
    xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="Application1"
    publicKeyToken="32ab4ba45e0a69a1"
    culture="neutral" />
    <bindingRedirect oldVersion="1.0.3075.0"
    newVersion="1.1.4322.0"/>
    </dependentAssembly>
    </assemblyBinding>
    </runtime>

    B
    Add the following XML element to the application configuration file.
    <configuration>
    <startup>
    <supportedRuntime version="1.1.4322" />
    <startup>
    </configuration>

    C
    Add the following XML element to the application configuration file.
    <configuration>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="Application1" publicKeyToken="32ab4ba45e0a69a1" culture="neutral" /> <bindingRedirect oldVersion="1.0.3075.0" newVersion="1.1.4322.0"/>
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>

    D
    Add the following XML element to the machine configuration file.
    <configuration>
    <startup> <requiredRuntime version="1.1.4322" />
    <startup>
    </configuration>

    Note: Not available
    1. Report
  10. Question: You write a class named Employee that includes the following code segment.
    Private m_EmployeeId As String
    Private m_EmployeeName As String
    Private m_JobTitleName As String
    Public Function GetName() As String
    Return m_EmployeeName
     End Function
    Public Function GetTitle() As String
    Return m_JobTitleName
    End Function
    End Class
    You need to expose this class to COM in a type library. The COM interface must also facilitate forward-compatibility across new versions of the Employee class.
    You need to choose a method for generating the COM interface. What should you do?

    A
    Add the following attribute to the class definition.
    <ClassInterface(ClassInterfaceType.AutoDual)> _
    Public Class Employee

    B
    Add the following attribute to the class definition.
    <ComVisible(True)> _
    Public Class Employee

    C
    Add the following attribute to the class definition.
    <ClassInterface(ClassInterfaceType.None)> _
    Public Class Employee

    D
    Define an interface for the class and add the following attribute to the class definition.
    <ClassInterface(ClassInterfaceType.None)> _
    Public Class Employee
    Implements IEmployee

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