Latest MCTS 70-536 Real Exam Download 111-120

Ensurepass

QUESTION 111

You need to retrieve all queued e-mail messages into a collection and ensure type safety. Which code segment should you use to define the signature of the GetQueuedEmailsFromDb() method in the Poller.cs file?

A. private static object[] GetQueuedEmailsFromDb(int queueID)

B. private static ArrayList GetQueuedEmailsFromDb(int queueID)

C. private static EmailMessages GetQueuedEmailsFromDb(int queueID)

D. private static IList<object> GetQueuedEmailsFromDb(int queueID)

Correct Answer: C


QUESTION 112

You need to ensure that the list of queued e-mail messages is sorted by priority value from highest to lowest. Which code segment should you add to line LE13 of the Local Entities?

A. return Priority.GetValueOrDefault(-1).CompareTo(other.Priority.GetValueOrDefault(-1)) * -1;

B. return Priority.GetValueOrDefault(-1).CompareTo(other.Priority.GetValueOrDefault(-1));

C. return Priority.Value.CompareTo(other.Priority.Value);

D. return Priority.Value.CompareTo(other.Priority.Value) * -1;

Correct Answer: A


QUESTION 113

You need to implement the EmailSenderService class so that the service sends queued e-mail messages when it is started and stops sending e-mail messages when it is stopped. Which code segments should you use? (Each correct answer is part of a complete solution. Choose two.)

A. protected override void OnStop()

{

Poller p = new Poller();Stop();

}

B. protected void Start(string[] args)

{

Start();

}

C. protected void Stop()

{

Stop();

}

D. protected override void OnStart(string[] args)

{

Start();

}

E. protected override void OnStop()

{

Stop();

}

F. protected void OnStart()

{

Start();

}

Correct Answer: DE


QUESTION 114

You need to ensure that dates and numbers are displayed correctly for each user based on location.

Which code segment should you add to line GL08 of the Global.asax file?

A. System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo(culture); System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;

B. CultureInfo info = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); info = CultureInfo.CreateSpecificCulture(culture);

C. System.Globalization.CultureInfo cultureInfo = CultureInfo.GetCultureInfo(culture); System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;

D. System.Globalization.CultureInfo cultureInfo = CultureInfo.CreateSpecificCulture(culture); System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;

Correct Answer: A


QUESTION 115

You need to store Product, MainProduct, and SecondaryProduct instances that end users place in the shopping cart by using a collection. Which code segment should you use to initiate the collection?

A. List<Product> products = new List<Product>();

B. ArrayList products = new ArrayList();

C. IList<Product> products = new List<Product>();

D. SortedList<string, Product> products = new SortedList<string, Product>();

Correct Answer: B


QUESTION 116

You need to read the content of the XML log file. Which code segment should you add to line LO04 of the Login.aspx.cs file?

A. FileInfo fi = new FileInfo(filePath); string xml = fi.ToString(); fi.Refresh();

B. StreamReader sr = File.OpenText(filePath); string xml = sr.ReadToEnd();

sr.Close();

C. FileInfo fi = new FileInfo(filePath); fi.Refresh();

string xml = fi.ToString();

D. StreamReader sr = File.OpenText(filePath); sr.Close();

string xml = sr.ReadToEnd();

Correct Answer: B


QUESTION 117

You need to implement the for loop of the Start() method contained in the Poller.cs file. Which code segments should you insert at line PO11 of the Poller.cs file? (Each correct answer presents part of the solution. Choose three.)

A. running.Add(1, false);

B. SenderThread(i);

C. Thread t = new Thread(Start);

D. thread.Start();

E. Thread thread = new Thread(new ParameterizedThreadStart(SenderThread));

F. running.Add(i, true);

G. thread.Start(i);

Correct Answer: DEF


QUESTION 118

You need to complete the SendEmail() method contained in the EmailUtility.cs file. Which code segments should you use? (Each correct answer presents part of the solution. Choose two.)

A. mm.From = new MailAddress(String.Join(mailTo, ";"));

B. foreach (string to in mailTo) mm.Headers.Add("to", to); Next

C. mm.From = new MailAddress(from);

D. foreach (string to in mailTo) mm.To.Add(to.Trim());

Correct Answer: CD


QUESTION 119

You need to log an entry in a custom event log when the EmailSenderService service is started and stopped. What should you do? (Each correct answer presents part of the solution. Choose three.)

A. Add the following code segment to line PO13 of the Poller.cs file: EventLog.WriteEntry("EmailSenderService", "Started", EventLogEntryType.Information);

B. Add the following code segment to line PO25 of the Poller.cs file:

EventLog.WriteEntry("Application", "EmailSenderService:Stopped", EventLogEntryType.Information);

C. Add the following code segment to line PO25 of the Poller.cs file: EventLog.WriteEntry("EmailSenderService", "Stopped", EventLogEntryType.Information);

D. Add the following code segment to line ES10 of the EmailSenderService.cs file: EventLog.CreateEventSource("Application", "EmailSenderService");

E. Add the following code segment to line PO13 of the Poller.cs file: EventLog.WriteEntry("Application", "EmailSenderService:Started", EventLogEntryType.

Information);

F. Add the following code segment to line ES10 of the EmailSenderService.cs file: EventLog.CreateEventSource("EmailSenderService", "EmailLog");

Correct Answer: ACF


QUESTION 120

Each order-processing step is a method that takes an Order object. Each method returns true if the step completes successfully or false if the step does not complete.

To support a custom set of steps specific to each client, the steps have been added to an event that is called when an order is processed. Vou need to ensure that the error property of the Order object is set to true if any method returns false.

With which code segment should you replace line OP48 in the OrderProcessor.es file?

A. foreach (Delegate process in OrderProcesses.GetlnvocationList()) { if ((bool)process.DynamicInvoke(new objectf] { order }) == false) { order.Error = true;

}

}

B. if (OrderProcesses.Invoke(order) == false)

{

order.Error = true;

}

C. if ((bool)OrderProcesses.Method.Invoke(null, new object[] { order }) == false) { order.Error = true;

}

D. OrderProcesses.Invoke(order);

foreach (Delegate process in OrderProcesses.GetlnvocationList()) { if ((bool)process.Target == false)

{

order.Error = true;

}

}

Correct Answer: A

Download Latest 70-536 Real Free Tests , help you to pass exam 100%.