1. Question: 

    You need to ensure that, for each exception, the central logging system logs the name of the method that caused the exception.

    Which code segment should you insert at line AS12 in the ApplicationServices.vb file?

    A
    Dim source As String = ex.StackTrace(0).ToString()

    B
    Dim source As String = ex.TargetSite.MethodHandle.Value.ToString()

    C
    Dim source As String = ex.Data("ExceptionSource").ToString()

    D
    Dim source As String = ex.TargetSite.Name

    Note: Not available
    1. Report
  2. Question: 

    The order-processing service must save submitted orders in a format that persists all properties on the Order object.

    You need to serialize Order objects.

    Which code segment should you insert at line OR22 in the OrderRepository.vb file?

    A
    Dim formatter As IFormatter = New BinaryFormatter()
    Dim storeStream As HemoryStream = New HemoryStream() formatter.Serialize(storeStream, order)

    B
    Dim serializer as XmlSerializer= new XrolSerializer( GetType (Order), Assembly.GetExecutingAssembly ().GetTypes())
    Dim storeStream As HemoryStream = New HemoryStream() serializer.Serialize(storeStream, order)

    C
    Dim serializer as XmlSerializer= new XmlSerializer( GetType (Order)) Dim storeStream As "A Composite Solution With Just One Click" - Certification Guaranteed 223 Microsoft 70-536 Exam HemoryStream = New HemoryStream() serializer.Serialize(storeStream, order)

    D
    Dim formatter As IFormatter = New BinaryFormatter(New SurrogateSelector(), New StreamingContext (StreamingContextStates.Persistence)) Dim storeStream As HemoryStream =
    New MemoryStream() formatter.Serialize(storeStream, order)

    Note: Not available
    1. Report
  3. Question: 

    You need to use the performance counters to ensure that the performance metrics are updated as required.

    Which code segment should you use as the body of the LogOrderFinished function in the ApplicationServices.vb file? (Each correct answer presents a complete solution. Choose two.)

    A
    totalCounter. Increment ()
    averageCounter.IncrementBy(DateTime.Now.Ticks - order.OrderDate.Ticks)
    averageCounterBase.
    Increment()

    B
    totalCounter.IncrementBy(totalCounter-RawValue)
    averageCounter.Increment()
    averageCounterBase.IncrementBy(TimeSpan.TicksPerSecond)

    C
    totalCounter.RawValue += 1
    averageCounter.Increment()
    averageCounterBase . IncrementBy (order .Order Date. Ticks - DateTime. Now. Ticks)

    D
    totalCounter. RawValue += 1
    averageCounter.IncrementBy(DateTime.Now.ToBinary() - order.OrderDate.ToBinary()) averageCounterBase.Increment()

    E
    totalCounter. Increment ()
    averageCounter.Increment()
    averageCounterBase.IncrementBy(DateTime.Now.Ticks)

    F
    totalCounter.IncrementBy(totalCounter.RawValue)
    averageCounter.IncrementBy(TimeSpan.TicksPerSecond)
    averageCounterBase.Increment()

    Note: Not available
    1. Report
  4. Question: Your application uses two threads, named threadOne and threadTwo. You need to modify the code to prevent the execution of threadOne until threadTwo completes execution. What should you do?

    A
    Call the Sleep method of threadOne.

    B
    Use a WaitCallback delegate to synchronize the threads.

    C
    Configure threadTwo to run at a higher priority.

    D
    Call the SpinLock method of threadOne.

    E
    Configure threadOne to run at a lower priority.

    Note: Not available
    1. Report
  5. 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
    EventLog= myLog = gcnew EventLog("Application", "."); for each (EventLogEntry= entry in myLog->Entries) {
    if (entry->Source == "MySource") {
    PersistToDB(entry);
    }
    }
    "A Composite Solution With Just One Click" - Certification Guaranteed 225 Microsoft 70-536 Exam

    B
    EventLog= myLog = gcnew EventLog("Application", "."); for each (EventLogEntry= entry in myLog->Entries) {
    if (entry->Source == "MySource") {
    if (entry->EntryType == EventLogEntryType::Error ||
    entry->EntryType == EventLogEntryType::Warning) {
    PersistToDB(entry);
    }
    }
    }

    C
    EventLog= myLog = gcnew EventLog("Application", "."); myLog->Source = "MySource";
    for each (EventLogEntry= entry in myLog->Entries) {
    if (entry->EntryType == (EventLogEntryType::Error &
    EventLogEntryType::Warning)) {
    PersistToDB(entry);
    }
    }

    D
    EventLog= myLog = gcnew EventLog("Application", "."); myLog->Source = "MySource";
    for each (EventLogEntry= entry in myLog->Entries) {
    if (entry->EntryType == EventLogEntryType::Error || entry->EntryType == EventLogEntryType::Warning) {
    PersistToDB(entry);
    }
    }

    Note: Not available
    1. Report
  6. Question: 

    You are developing a custom event handler to automatically print all open documents. The event

    handler helps specify the number of copies to be printed. You need to develop a custom event arguments class to pass as a parameter to the event handler. Which code segment should you use?

    A
    Public Class PrintingArgs
    Inherits EventArgs
    Private _copies As Integer
    Public Sub New(ByVal numberOfCopies As Integer)
    Me._copies = numberOfCopies
    End Sub
    Public ReadOnly Property Copies() As Integer
    Get
    Return Me._copies
    End Get
    End Property
    End Class

    B
    Public Class PrintingArgs
    Private eventArgs As EventArgs
    Public Sub New(ByVal args As EventArgs)
    Me.eventArgs = args
    End Sub
    Public ReadOnly Property Args() As EventArgs
    Get
    Return eventArgs
    End Get
    End Property
    End Class

    C
    Public Class PrintingArgs
    Private _copies As Integer
    Public Sub New(ByVal numberOfCopies As Integer)
    Me._copies = numberOfCopies
    End Sub
    Public ReadOnly Property Copies() As Integer
    Get
    Return Me._copies
    End Get End PropertyEnd Class

    D
    Public Class PrintingArgs
    Inherits EventArgs
    Private copies As Integer
    End Class

    Note: Not available
    1. Report
  7. Question: 

    You write a class named Employee that includes the following code segment.

    public class Employee {

    string employeeId, employeeName, jobTitleName;

    public string GetName() { return employeeName; }

    public string GetTitle() { return jobTitleName; }

    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
    Define an interface for the class and add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType.None)]
    public class Employee : IEmployee {

    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
    Add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class Employee {

    Note: Not available
    1. Report
  8. 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 void StartService(string serverName){

    02 ServiceController crtl = new

    03 ServiceController("FileService");

    04 if (crtl.Status == ServiceControllerStatus.Stopped){

    05 }

    06 }

    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 03 and 04:
    crtl.Site.Name = serverName;

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

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

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

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

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

    Note: Not available
    1. Report
  9. Question: You need to return the contents of an isolated storage file as a string. The file is machine-scoped and is named Settings.dat. Which code segment should you use?

    A
    IsolatedStorageFile= isoFile;
    isoFile = IsolatedStorageFile::GetMachineStoreForAssembly(); IsolatedStorageFileStream= isoStream; 
    isoStream = gcnew IsolatedStorageFileStream(

    "Settings.dat", FileMode::Open, isoFile);
    String= result = (gcnew StreamReader(isoStream))->ReadToEnd();

    B
    IsolatedStorageFileStream= isoStream;
    isoStream = gcnew IsolatedStorageFileStream(
    "Settings.dat", FileMode::Open);
    String= result = isoStream->ToString();

    C
    IsolatedStorageFile= isoFile;
    isoFile = IsolatedStorageFile::GetMachineStoreForAssembly(); IsolatedStorageFileStream= isoStream; isoStream = gcnew IsolatedStorageFileStream(
    "Settings.dat", FileMode::Open, isoFile);
    String= result = isoStream->ToString();

    D
    IsolatedStorageFileStream= isoStream;
    isoStream = gcnew IsolatedStorageFileStream(
    "Settings.dat", FileMode::Open);
    String= result = (gcnew StreamReader(isoStream))->ReadToEnd();

    Note: Not available
    1. Report
  10. Question: You need to call an unmanaged function from your managed code by using platform invoke services. What should you do?

    A
    Import a type library as an assembly and then create instances of COM object.

    B
    Export a type library for your managed code.

    C
    Create a class to hold DLL functions and then create prototype methods by using managed code.

    D
    Register your assembly by using COM and then reference your managed code from COM.

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