Mar 2016 updated: Pass4sure Microsoft 70-536 practice 106-120

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 70-536 Exam Dumps (PDF & VCE):
Available on: https://www.certleader.com/70-536-dumps.html


70-536 Product Description:
Exam Number/Code: 70-536 vce
Exam name: TS:MS.NET Framework 2.0-Application Develop Foundation
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Instant Access to Free VCE Files: Microsoft 70-536 TS:MS.NET Framework 2.0-Application Develop Foundation

70-536 examcollection

Question No. 106

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. ArrayList al = new ArrayList(); 

lock (al.SyncRoot) 

return al; 

B. ArrayList al = new ArrayList(); 

lock (al.SyncRoot.GetType()) 

return al; 

C. ArrayList al = new ArrayList(); 

Monitor.Enter(al); 

Monitor.Exit(al); 

return al; 

D. ArrayList al = new ArrayList(); 

ArrayList sync_al = ArrayList.Synchronized(al); 

return sync_al; 

Answer:


Question No. 107

You work as aplication developer at Cer-Tech.com. You have recently created an aplication that includes the code shown below. 

You now need to invoke the GetFileContents method asynchronously. 

You have to ensure that the code you use to invoke the GetFileContents method will continue to process other user instructions, and displays the results as soon as the GetFileContents method finishes processing. 

What should you do? 

A. Use the following code: 

GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); 

IAsyncResult result = delAsync.BeginInvoke (null, null); 

while (!result.IsCompleted) 

//Process other user instructions } string strFile - delAsync.EndInvoke (result); 

B. Use the following code: 

GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); 

string strFile - delAsync.Invoke (); 

C. Use the following code: 

string strFile - delAsync.Invoke (); 

D. Use the following code: 

GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); 

IAsyncResult result = delAsync.BeginInvoke (null, null); 

//Process other user instructions 

string strFile - delAsync.EndInvoke (result); 

Answer:


Question No. 108

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 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) 

Answer:


Question No. 109

You need to implement the For loop of the Start() method contained in the Poller.vb file. 

Which code segments should you insert at line PO10 of the Poller.vb file? (Each correct answer presents part of the solution. Choose three.) 

A. thread.Start(i) 

B. thread.Start() 

C. running.Add(1, False) 

D. SenderThread(i) 

E. Dim thread As Thread = New ThreadfNew ParameterizedThreadStart(AddressOf SenderThread)) 

F. running.Add(i, True) 

G. Dim t As Thread = New Thread(Start) 

Answer: BEF 


Question No. 110

You are developing a fiscal report for a customer. Your customer has a main office in the United States and a satellite office in Mexico. You need to ensure that when users in the satellite office generate the report, the current date is displayed in Mexican Spanish format. Which code segment should you use? 

A. CultureInfo= culture = gcnew CultureInfo("es-MX", false); 

DateTimeFormatInfo= dtfi = culture->DateTimeFormat; 

DateTime= dt = gcnew DateTime(DateTime::Today::Year, 

DateTime::Today::Month, DateTime::Today::Day); 

String= dateString = dt->ToString(dtfi->LongDatePattern); 

B. String= dateString = 

DateTimeFormatInfo::CurrentInfo 

::GetMonthName(DateTime::Today::Month); 

String= dateString = DateTime::Today::Month::ToString("es-MX"); 

C. Calendar= cal = gcnew CultureInfo("es-MX", false)::Calendar; 

DateTime= dt = gcnew DateTime(DateTime::Today::Year, 

DateTime::Today::Month, DateTime::Today::Day); 

String= dateString = dt->ToString(); 

Answer:


Question No. 111

You are developing a server application that will transmit sensitive information on a network. You create an X509Certificate object named certificate and a TcpClient object named client. You need to create an SslStream to communicate by using the Transport Layer Security 1.0 protocol. Which code segment should you use? 

A. SslStream= ssl = gcnew SslStream(Client->GetStream()); 

ssl->AuthenticateAsServer(certificate, false, SslProtocols::None, true); 

B. SslStream =ssl = gcnew SslStream(Client->GetStream()); 

ssl->AuthenticateAsServer(certificate, false, SslProtocols::Tls, true); 

C. SslStream =ssl = gcnew SslStream(Client->GetStream()); 

ssl->AuthenticateAsServer(certificate, false, SslProtocols::Ssl3, true); 

D. SslStream =ssl = gcnew SslStream(Client->GetStream()); 

ssl->AuthenticateAsServer(certificate, false, SslProtocols::Ssl2, true); 

Answer:


Question No. 112

You are developing a utility screen for a new client application. The utility screen displays a thermometer that conveys the current status of processes being carried out by the application. You need to draw a rectangle on the screen to serve as the background of the thermometer as shown in the exhibit. 


The rectangle must be filled with gradient shading. (Click the Exhibit button.) Which code segment should you choose? 

A. RectangleF rectangle = new RectangleF(10f, 10f, 450f, 25f); 

SolidBrush rectangleBrush = 

new SolidBrush(Color.AliceBlue); 

Pen rectanglePen = new Pen(rectangleBrush); 

Graphics g = this.CreateGraphics(); 

B. DrawRectangle(rectangleBrush, rectangle); 

C. Rectangle rectangle = new Rectangle(10, 10, 450, 25); 

LinearGradientBrush rectangleBrush = 

new LinearGradientBrush(rectangle, Color.AliceBlue, 

Color.CornflowerBlue, 

LinearGradientMode.ForwardDiagonal); 

Pen rectanglePen = new Pen(rectangleBrush); 

Graphics g = this.CreateGraphics(); 

D. DrawRectangle(rectanglePen, rectangle); 

E. RectangleF rectangle = new RectangleF(10f, 10f, 450f, 25f); 

Point[] points = new Point[] {new Point(0, 0), 

new Point(110, 145)}; 

LinearGradientBrush rectangleBrush = 

new LinearGradientBrush(rectangle, Color.AliceBlue, 

Color.CornflowerBlue, 

LinearGradientMode.ForwardDiagonal); 

Pen rectanglePen = new Pen(rectangleBrush); 

Graphics g = this.CreateGraphics(); 

F. DrawPolygon(rectanglePen, points); 

G. Rectangle rectangle = new Rectangle(10, 10, 450, 25); 

LinearGradientBrush rectangleBrush = 

new LinearGradientBrush(rectangle, Color.AliceBlue, 

Color.CornflowerBlue, 

LinearGradientMode.ForwardDiagonal); 

Pen rectanglePen = new Pen(rectangleBrush); 

Graphics g = this.CreateGraphics(); 

H. FillRectangle(rectangleBrush, rectangle); 

Answer:


Question No. 113

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); 

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); 

Answer:


Question No. 114

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> 

</configuration> 

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> 

Answer:


Question No. 115

You use Reflection to obtain information about a method named MyMethod. You need to ascertain whether MyMethod is accessible to a derived class. What should you do? 

A. Call the IsAssembly property of the MethodInfo class. 

B. Call the IsVirtual property of the MethodInfo class. 

C. Call the IsStatic property of the MethodInfo class. 

D. Call the IsFamily property of the MethodInfo class. 

Answer:


Question No. 116

You need to identify a type that meets the following criteria: Is always a number. Is not greater than 65,535. Which type should you choose? 

A. System.IntPtr 

B. int 

C. System.UInt16 

D. System.String 

Answer:


Question No. 117

You are defining a class named CompanyClass that contains several child objects. CompanyClass contains a method named ProcessChildren that performs actions on the child objects. CompanyClass objects will be serializable. 

You need to ensure that the ProcessChildren method is executed after the CompanyClass object and all its child objects are reconstructed. 

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) 

A. Apply the OnDeserializing attribute to the ProcessChildren method. 

B. Specify that CompanyClass implements the IDeserializationCallback interface. 

C. Specify that CompanyClass inherits from the ObjectManager class. 

D. Apply the OnSerialized attribute to the ProcessChildren method. 

E. Create a GetObjectData method that calls ProcessChildren. 

F. Create an OnDeserialization method that calls ProcessChildren. 

Answer: BF 


Question No. 118

You are creating a new security policy for an application domain. You write the following lines of code. 

PolicyLevel policy = PolicyLevel.CreateAppDomainLevel(); 

PolicyStatement noTrustStatement = 

new PolicyStatement( 

policy.GetNamedPermissionSet("Nothing")); 

PolicyStatement fullTrustStatement = 

new PolicyStatement( 

policy.GetNamedPermissionSet("FullTrust")); 

You need to arrange code groups for the policy so that loaded assemblies default to the Nothing permission set. If the assembly originates from a trusted zone, the security policy must grant the assembly the FullTrust permission set. 

Which code segment should you use? 

A. CodeGroup group1 = new FirstMatchCodeGroup( 

new AllMembershipCondition(), 

noTrustStatement); 

CodeGroup group2 = new UnionCodeGroup( 

new ZoneMembershipCondition(SecurityZone.Trusted), 

fullTrustStatement); 

group1.AddChild(group2); 

B. CodeGroup group = new FirstMatchCodeGroup( 

new AllMembershipCondition(), 

noTrustStatement); 

C. CodeGroup group = new UnionCodeGroup( 

new ZoneMembershipCondition(SecurityZone.Trusted), 

fullTrustStatement); 

D. CodeGroup group1 = new FirstMatchCodeGroup( 

new ZoneMembershipCondition(SecurityZone.Trusted), 

fullTrustStatement); 

CodeGroup group2 = new UnionCoderoup( 

new AllMembershipCondition(), 

noTrustStatement); 

group1.AddChild(group2); 

Answer:


Question No. 119

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 { 

private EventArgs eventArgs; 

public PrintingArgs(EventArgs ea) { 

this.eventArgs = ea; 

public EventArgs Args { 

get { return eventArgs; } 

B. public class PrintingArgs : EventArgs { 

private int copies; 

public PrintingArgs(int numberOfCopies) { 

this.copies = numberOfCopies; 

public int Copies { 

get { return this.copies; } 

C. public class PrintingArgs : EventArgs { 

private int copies; 

D. public class PrintingArgs { 

private int copies; 

public PrintingArgs(int numberOfCopies) { 

this.copies = numberOfCopies; 

public int Copies { 

get { return this.copies; } 

Answer:


Question No. 120

You are developing a routine that will periodically perform a calculation based on regularly changing values from legacy systems. You write the following lines of code. (Line numbers are included for reference only.) 

01 Dim exitLoop As Boolean = False 

02 Do 

04 exitLoop = PerformCalculation() 

05 Loop While Not exitLoop 

You need to write a code segment to ensure that the calculation is performed at 30-second intervals. 

You must ensure that minimum processor resources are used between the calculations. Which code segment should you insert at line 03? 

A. Thread.Sleep(30000); 

B. Thread.SpinWait(30); 

C. Thread.SpinWait(30000); 

D. Dim thrdCurrent As Thread = Thread.CurrentThread; thrdCurrent.Priority = ThreadPriority.Lowest; 

E. Dim thrdCurrent As Thread = Thread.CurrentThread; 

thrdCurrent.Priority = ThreadPriority.BelowNormal; 

Answer: