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 :

    02 void StartService(String= serverName){ 04 ServiceController= crtl = gcnew

    05 ServiceController("FileService");

    06 if (crtl->Status == ServiceControllerStatus::Stopped){}

    07 }

    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.ServiceName = serverName;

    B
    Insert the following line of code between lines 04 and 05:
    "A Composite Solution With Just One Click" - Certification Guaranteed 281 Microsoft 70-536 Exam
    crtl.ExecuteCommand(0);

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

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

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

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

    Note: Not available
    1. Report
  2. Question: 

    You are developing a method to encrypt sensitive data with the Data Encryption Standard (DES) algorithm. Your method accepts the following parameters:

    The byte array to be encrypted, which is named message

    An encryption key, which is named key

    An initialization vector, which is named iv

    You need to encrypt the data. You also need to write the encrypted data to a MemoryStream object.

    Which code segment should you use?

    A
    DES des = new DESCryptoServiceProvider();
    "A Composite Solution With Just One Click" - Certification Guaranteed 282 Microsoft 70-536 Exam ICryptoTransform crypto = des.CreateEncryptor(key, iv); MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);

    B
    DES des = new DESCryptoServiceProvider();
    des.BlockSize = message.Length;
    ICryptoTransform crypto = des.CreateEncryptor(key, iv); MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write); cryptoStream.Write(message, 0, message.Length);

    C
    DES des = new DESCryptoServiceProvider();
    ICryptoTransform crypto = des.CreateEncryptor(); MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);

    D
    DES des = new DESCryptoServiceProvider();
    ICryptoTransform crypto = des.CreateDecryptor(key, iv); MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);

    Note: Not available
    1. Report
  3. Question: You are developing a method to hash data with the Secure Hash Algorithm. The data is passed to your method as a byte array named message. You need to compute the hash of the incoming parameter by using SHA1. You also need to place the result into a byte array named hash. Which code segment should you use?

    A
    SHA1 =sha = gcnew SHA1CryptoServiceProvider();
    array<Byte>=hash = nullptr;
    sha->TransformBlock(message, 0, message->Length, hash, 0);

    B
    SHA1 =sha = gcnew SHA1CryptoServiceProvider();
    sha->GetHashCode();
    array<Byte>=hash = sha->Hash;

    C
    SHA1 =sha = gcnew SHA1CryptoServiceProvider();
    "A Composite Solution With Just One Click" - Certification Guaranteed 283 Microsoft 70-536 Exam
    array<Byte>=hash = BitConverter::GetBytes(sha->GetHashCode());

    D
    SHA1 =sha = gcnew SHA1CryptoServiceProvider();
    array<Byte>=hash = sha->ComputeHash(message);

    Note: Not available
    1. Report
  4. Question: You are writing an application that uses SOAP to exchange data with other applications. You use a Department class that inherits from ArrayList to send objects to another application. The Department object is named dept. You need to ensure that the application serializes the Department object for transport by using SOAP. Which code should you use?

    A
    SoapFormatter formatter = new SoapFormatter();
    byte[] buffer = new byte[dept.Capacity];
    MemoryStream stream = new MemoryStream(buffer);
    foreach (object o in dept) {
    formatter.Serialize(stream, o); }

    B
    SoapFormatter formatter = new SoapFormatter();
    MemoryStream stream = new MemoryStream();
    foreach (object o in dept) {
    formatter.Serialize(stream, o); }

    C
    SoapFormatter formatter = new SoapFormatter();
    byte[] buffer = new byte[dept.Capacity];
    MemoryStream stream = new MemoryStream(buffer);
    formatter.Serialize(stream, dept);

    D
    SoapFormatter formatter = new SoapFormatter();
    MemoryStream stream = new MemoryStream();
    formatter.Serialize(stream, dept);

    Note: Not available
    1. Report
  5. Question: 

    You are developing an application for a client residing in Hong Kong. You need to display negative currency values by using a minus sign. Which code segment should you use?

    A
    NumberFormatInfo= culture =
    gcnew CultureInfo("zh-HK")::NumberFormat;
    culture->CurrencyNegativePattern = 1;
    return numberToPrint->ToString("C", culture);

    B
    NumberFormatInfo= culture =
    gcnew CultureInfo("zh-HK")::NumberFormat;
    culture->NumberNegativePattern = 1;
    return numberToPrint->ToString("C", culture);

    C
    CultureInfo= culture =
    gcnew CultureInfo("zh-HK");
    return numberToPrint->ToString("()", culture);

    D
    CultureInfo= culture =
    gcnew CultureInfo("zh-HK");
    return numberToPrint->ToString("-(0)", culture);

    Note: Not available
    1. Report
  6. 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
    public ref class CalculationValues {...};
    public ref class Calculator {
    public :
    void PerformCalculation(Object= values) {}
    };
    public ref class ThreadTest{
    private :
    void DoWork (){
    CalculationValues= myValues = gcnew CalculationValues(); Calculator = calc = gcnew Calculator();
    Thread= newThread = gcnew Thread(
    gcnew ParameterizedThreadStart(calc,
    &Calculator::PerformCalculation));
    newThread->Start(myValues);
    }
    };

    B
    public ref class CalculationValues {...};
    "A Composite Solution With Just One Click" - Certification Guaranteed 285 Microsoft 70-536 Exam
    public ref class Calculator {
    public :
    void PerformCalculation() {}
    };
    public ref class ThreadTest{
    private :
    void DoWork (){
    CalculationValues= myValues = gcnew CalculationValues(); Calculator = calc = gcnew Calculator();
    ThreadStart= delStart = gcnew
    ThreadStart(calc, &Calculator::PerformCalculation);
    Thread= newThread = gcnew Thread(delStart);
    if (newThread->IsAlive) {
    newThread->Start(myValues);
    }
    }
    };

    C
    public ref class CalculationValues {...};
    public ref class Calculator {
    public :
    void PerformCalculation(CalculationValues= values) {}
    };
    public ref class ThreadTest{
    private :
    void DoWork (){
    CalculationValues= myValues = gcnew CalculationValues(); Calculator = calc = gcnew Calculator(); Application::DoEvents();
    calc->PerformCalculation(myValues);
    Application::DoEvents();
    }
    };

    D
    public ref class CalculationValues {...};
    public ref class Calculator {
    public :
    void PerformCalculation() {}
    };
    public ref class ThreadTest{
    private :
    void DoWork (){
    CalculationValues= myValues = gcnew CalculationValues(); Calculator = calc = gcnew Calculator();
    Thread= newThread = gcnew Thread(
    gcnew ThreadStart(calc, &Calculator::PerformCalculation)); newThread->Start(myValues);
    }
    };
    "A Composite Solution With Just One Click" - Certification Guaranteed 286 Microsoft 70-536 Exam

    Note: Not available
    1. Report
  7. 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 void PerformCalculation() {
    ...
    }
    private void DoWork(){
    CalculationValues myValues = new CalculationValues(); Thread newThread = new Thread(
    new ThreadStart(PerformCalculation)); newThread.Start(myValues);
    }

    B
    private void PerformCalculation (CalculationValues values) {
    ...
    }
    private void DoWork(){
    CalculationValues myValues = new CalculationValues(); Application.DoEvents();
    PerformCalculation(myValues);
    Application.DoEvents();
    }

    C
    private void PerformCalculation() {
    ...
    }
    private void DoWork(){
    CalculationValues myValues = new CalculationValues(); ThreadStart delStart = new
    ThreadStart(PerformCalculation);
    Thread newThread = new Thread(delStart);
    if (newThread.IsAlive) {
    newThread.Start(myValues);
    }
    }
    "A Composite Solution With Just One Click" - Certification Guaranteed 287 Microsoft 70-536 Exam

    D
    private void PerformCalculation(object values) {
    ...
    }
    private void DoWork(){
    CalculationValues myValues = new CalculationValues(); Thread newThread = new Thread(
    new ParameterizedThreadStart(PerformCalculation));
    newThread.Start(myValues);
    }

    Note: Not available
    1. Report
  8. Question: You are creating a class that performs complex financial calculations. The class contains a method named GetCurrentRate that retrieves the current interest rate and a variable named currRate that stores the current interest rate. You write serialized representations of the class. You need to write a code segment that updates the currRate variable with the current interest rate when an instance of the class is deserialized. Which code segment should you use?

    A
    [OnSerializing]
    internal void UpdateValue (StreamingContext context) { currRate = GetCurrentRate();
    }

    B
    [OnDeserializing]
    internal void UpdateValue(SerializationInfo info) {
    info.AddValue("currentRate", GetCurrentRate());
    }

    C
    [OnSerializing]
    internal void UpdateValue(SerializationInfo info) {
    info.AddValue("currentRate", GetCurrentRate());
    }

    D
    [OnDeserialized]
    internal void UpdateValue(StreamingContext context) { currRate = GetCurrentRate();
    }

    Note: Not available
    1. Report
  9. Question: You need to write a code segment that transfers the contents of a byte array named dataToSend by using a NetworkStream object named netStream. You need to use a cache of size 8,192 bytes. Which code segment should you use?

    A
    MemoryStream= memStream = gcnew MemoryStream(8192);
    netStream->Write(dataToSend, 0, (int) memStream->Length);

    B
    MemoryStream= memStream = gcnew MemoryStream(8192);
    memStream->Write(dataToSend, 0, (int) netStream->Length);

    C
    BufferedStream= bufStream =
    gcnew BufferedStream(netStream, 8192);
    bufStream->Write(dataToSend, 0, dataToSend->Length);

    D
    BufferedStream= bufStream =
    gcnew BufferedStream(netStream);
    bufStream->Write(dataToSend, 0, 8192);

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

    A
    ManagementObjectSearcher searcher =
    new ManagementObjectSearcher();
    searcher.Scope = new ManagementScope("Win32_Service"); foreach (ManagementObject svc in searcher.Get()) {
    if ((string)svc["State"] == "Paused") {
    Collection1.Add(svc["DisplayName"]);
    }
    }

    B
    ManagementObjectSearcher searcher =
    new ManagementObjectSearcher(
    "Select * from Win32_Service", "State = 'Paused'");
    foreach (ManagementObject svc in searcher.Get()) {
    Collection1.Add(svc["DisplayName"]);
    }

    C
    ManagementObjectSearcher searcher =
    new ManagementObjectSearcher(
    "Select * from Win32_Service where State = 'Paused'"); foreach (ManagementObject svc in searcher. Get()) {
    Collection1.Add(svc["DisplayName"]);
    }

    D
    ManagementObjectSearcher searcher =
    new ManagementObjectSearcher(
    "Select * from Win32_Service");
    foreach (ManagementObject svc in searcher.Get()) {
    if ((string) svc["State"] == "'Paused'") {
    Collection1.Add(svc["DisplayName"]);
    }
    }

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