Renovate 70-536: Actualtests real forum from 46 to 60

★ 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. 46

DRAG DROP 

You create a service application that monitors free space on a hard disk drive. 

You must ensure that the service application runs in the background and monitors the . 


What should you do? To answer, you need to move the three appropriate actions from the list of actions to the answer area and arrange them in the correct order. 


Answer: 


Question No. 47

You write the following code to call a function from the Win32 Application Programming Interface (API) by using platform invoke. 

int rc = MessageBox(hWnd, text, caption, type); 

You need to define a method prototype. Which code segment should you use? 

A. [DllImport("user32")] 

public static extern int MessageBox(int hWnd, String text,String caption, uint 

type); 

B. [DllImport("user32")] 

public static extern int MessageBoxA(int hWnd, String text,String caption, uint 

type); 

C. [DllImport("user32")] 

public static extern int Win32API_User32_MessageBox(int hWnd, String text, 

String caption, uint type); 

D. [DllImport(@"C:\WINDOWS\system32\user32.dll")] 

public static extern int MessageBox(int hWnd, String text,String caption, uint 

type); 

Answer:


Question No. 48

You create Microsoft Windows-based applications. 

You create an application that requires users to be authenticated by a domain controller. 

The application contains a series of processor intensive method calls that require different database connections. 

A bug is reported during testing. 

The bug description states that the application hangs during one of the processor-intensive calls more than 50 percent of the times when the method is executed. 

Your unit test for the same method was successful. 

You need to reproduce the bug. 

Which two factors should you ascertain from the tester? (Each correct answer presents part of the solution. Choose two.) 

A. Security credentials of the logged on user 

B. Code access security settings 

C. Hardware settings 

D. Network settings 

E. Database settings 

Answer: DE 


Question No. 49

You are developing a method to call a COM component. You need to use declarative security to explicitly request the runtime to perform a full stack walk. You must ensure that all callers have the required level of trust for COM interop before the callers execute your method. Which attribute should you place on the method? 

A. [SecurityPermission( 

SecurityAction.Demand, 

Flags=SecurityPermissionFlag.UnmanagedCode) 

B. [SecurityPermission( 

SecurityAction.Assert, 

Flags = SecurityPermissionFlag.UnmanagedCode) 

C. [SecurityPermission( 

SecurityAction.Deny, 

Flags = SecurityPermissionFlag.UnmanagedCode) 

D. [SecurityPermission( 

SecurityAction.LinkDemand, 

Flags=SecurityPermissionFlag.UnmanagedCode) 

Answer:


Question No. 50

You need to write a code segment that performs the following tasks: 

Retrieve the name of each paused service. 

Passe the name to the Add method of Collection1. 

Which code segment should you use? 

A. Dim searcher As ManagementObjectSearcher = _ 

New ManagementObjectSearcher( _ 

"Select * from Win32_Service where State = 'Paused'") 

For Each svc As ManagementObject In searcher.Get() 

Collection1.Add(svc("DisplayName")) 

Next 

B. Dim searcher As ManagementObjectSearcher = _ 

New ManagementObjectSearcher( _ 

"Select * from Win32_Service") 

For Each svc As ManagementObject In searcher.Get() 

If svc("State").ToString() = "'Paused'" Then 

Collection1.Add(svc("DisplayName")) 

End If 

Next 

C. Dim searcher As New ManagementObjectSearcher() 

searcher.Scope = New ManagementScope("Win32_Service") 

For Each svc As ManagementObject In searcher.Get() 

If svc("State").ToString() = "Paused" Then 

Collection1.Add(svc("DisplayName")) 

End If 

Next 

D. Dim searcher As ManagementObjectSearcher = _ 

New ManagementObjectSearcher ( _ 

"Select * from Win32_Service", "State = 'Paused'") 

For Each svc As ManagementObject In searcher.Get() 

Collection1.Add(svc("DisplayName")) 

Next 

Answer:


Question No. 51

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. Dim objSHA As New SHA1CryptoServiceProvider 

Dim hash() As Byte = objSHA.ComputeHash(message) 

B. Dim objSHA As New SHA1CryptoServiceProvider 

Dim hash() As Byte = Nothing 

objSHA.TransformBlock(message, 0, message.Length, hash, 0) 

C. Dim objSHA As New SHA1CryptoServiceProvider 

Dim hash() As Byte = BitConverter.GetBytes(objSHA.GetHashCode) 

D. Dim objSHA As New SHA1CryptoServiceProvider 

objSHA.GetHashCode() 

Dim hash() As Byte = objSHA.Hash 

Answer:


Question No. 52

You work as an application developer. You are currently in the process of creating an application that reads binary information from a file. 

You need to ensure that the only the first kilobyte of data is retrieved. 

Vhat should you do? 

A. Use the following code: FileStream fs = new FileStream ("C:\\file.txt' FiloModo.Open) 

BufferedStream bs = new BufferedStream (fs); 

byte [ ] bytes = new byte [1023]; 

bs. Head (bytes, 0, bytes. Length) ; 

bs. Close 0 ; 

for (int i = 0; i < bytes, Length-1: i++) 

Console, WriteLitie {"{0} : [!}", I, bytes [i]); 

B. Use the following code: 

FileStream fs = new FileStream ("C:\\file. txt", FileMode.Open); 

byte [ ] bytes = new byte [1023]; 

fs. Read (bytes, 0, bytes. Length); 

fs. Close 0 ; 

for 0tit i = 0; i < bytes. Length-1 ; L++) 

Console. WriteLine (*"{0) : (1}", I, bytes [i]); 

C. Use the following code: 

FileStream fs = new FileStream ("C:\\file. txt", FileMode.Open); BufferedStream bs = new 

BufferedStream (Is); 

byte [ ] bytes = new byte [1023]: 

bytes = bs. ReadAllBytes (0, 1023): 

bs. Close () ; 

for (int i = 0; i < bytes.Length-l; i++) 

Console. WriteLine ("{0} : {1}", I, bytes [i]); 

D. Use the following code: 

FileStream fs = new FileStream ('CrWfile. txt", FileMode.Open): 

BufferedStream bs = new BufferedStream (f s); 

byte [ ] bytes = new byte [1023] ; 

bs. Read (bytes) ; 

bs. Close 0 ; 

for (itit i = 0; i < bytes.Length-1; i++) 

Console. WriteLine {"{0} : {1}", T, bytes [i]): 

Answer:


Question No. 53

You are developing a multithreaded application. You need to ensure that a shared resource maintains a consistent state when multiple threads update it. You also need to permit multiple threads to read the shared resource concurrently. What should you do? 

A. Use the AcquireWriterLock and ReleaseWriterLock methods of the ReaderWriterLock class when updating the shared resource. Use the AcquireReaderLock and ReleaseReaderLock methods of the ReaderWriterLock class when reading from the shared resource. 

B. Always access the resource within a lock statement block. 

C. Create a wrapper class to protect the resource and always access the resource by using static methods of the wrapper class. 

D. Always use a single-threaded apartment when accessing the resource. 

Answer:


Question No. 54

You are creating an application that retrieves values from a custom section of the application configuration file. 

The custom section uses XML as shown in the following block. 

<ProjectSection name="ProjectCompany"> 

<role name="administrator" /> 

<role name="manager" /> 

<role name="support" /> 

</ProjectSection> 

You need to write a code segment to define a class named Role. You need to ensure that the Role class is initialized with values that are retrieved from the custom section of the configuration file. Which code segment should you use? 

A. public class Role : ConfigurationElement 

internal string ElementName = “name”; 

[ConfigurationProperty("role")] 

public string Name 

get { return ((string)base[“role”]); } 

B. public class Role : ConfigurationElement 

internal string ElementName = “role”; 

[ConfigurationProperty("name", RequiredValue = true)] 

public string Name 

get { return ((string)base[“name”]); } 

C. public class Role : ConfigurationElement 

internal string ElementName = “role”; 

private String name; 

[ConfigurationProperty("name")] 

public string Name 

get { return name; } 

D. public class Role : ConfigurationElement 

internal string ElementName = “name”; 

private String name; 

[ConfigurationProperty("role", RequiredValue = true)] 

public string Name 

get { return name; } 

Answer:


Question No. 55

You need to write a multicast delegate that accepts a DateTime argument and returns a Boolean value. Which code segment should you use? 

A. public delegate int PowerDeviceOn(bool,DateTime); 

B. public delegate bool PowerDeviceOn(Object,EventArgs); 

C. public delegate void PowerDeviceOn(DateTime); 

D. public delegate bool PowerDeviceOn(DateTime); 

Answer:


Question No. 56

DRAG DROP 

You are testing a newly developed method named PersistToDB. The method accepts a parameter of type EventLogEntry and does not return a value. 

The current test function is shown in the following code segment: 

01 Public Sub TestPersistToDB() 

02 

03 For Each entry As EventLogEntry In myLog.Entries 

04 

05 If entry.Source = "MySource" Then 

06 

07 End If 

08 

09 Next 

10

11 End Sub 

The test function must read entries from the application log of local computers and then pass the entries to the PersistToDB() method. The test function implementation must pass only events of type Error or Warning from a source named MySource to the PersistToDB() method. 

You need to complete the code segment. 

Which code segments should you add to line 02 and between lines 05 and 07 in sequence? 

To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. 


Answer: 



Question No. 57

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

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

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

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.CreateEncryptor(key, iv); 

MemoryStream cipherStream = new MemoryStream(); 

CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, 

CryptoStreamMode.Write); 

cryptoStream.Write(message, 0, message.Length); 

Answer:


Question No. 58

You create a service application that monitors free space on a hard disk drive. 

You need to ensure that the service application runs in the background and monitors the free space every minute. 

What should you do? (Each correct answer presents part of the solution. Choose three.) 

A. Add an instance of the System.Windows.Forms.Timer class to the Service class and configure it to fire every minute 

B. Add code to the default constructor of the Service class to monitor the free space on the hard disk drive 

C. Add code to the Tick event handler of the timer to monitor the free space on the hard disk drive 

D. Add code to the OnStart() method of the Service class to monitor the free space on the hard disk drive 

E. Add code to the OnStart() method of the Service class to start the timer. 

F. Add code to the Elapsed event handler of the timer to monitor the free space on the hard disk drive 

G. Add an instance of the System.Timers.Timer class to the Service class and configure it to fire every minute 

Answer: EFG 


Question No. 59

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 = new SslStream(client.GetStream()); 

ssl.AuthenticateAsServer(certificate,false, SslProtocols.None, true); 

B. SslStream ssl = new SslStream(client.GetStream()); 

ssl.AuthenticateAsServer(certificate,false, SslProtocols.Ssl3, true); 

C. SslStream ssl = new SslStream(client.GetStream()); 

ssl.AuthenticateAsServer(certificate,false, SslProtocols.Ssl2, true); 

D. SslStream ssl = new SslStream(client.GetStream()); 

ssl.AuthenticateAsServer(certificate,false, SslProtocols.Tls, true); 

Answer:


Question No. 60

You are developing an auditing application to display the trusted ClickOnce applications that are installed on a computer. You need the auditing application to display the origin of each trusted application. Which code segment should you use? 

A. Dim objTrusts As ApplicationTrustCollection 

objTrusts = ApplicationSecurityManager.UserApplicationTrusts 

For Each objTrust As ApplicationTrust In objTrusts 

Console.WriteLine(objTrust.ToString) 

Next 

B. Dim objTrusts As ApplicationTrustCollection 

objTrusts = ApplicationSecurityManager.UserApplicationTrusts 

For Each objTrust As ApplicationTrust In objTrusts 

Console.WriteLine(objTrust.ExtraInfo.ToString) 

Next 

C. Dim objTrusts As ApplicationTrustCollection 

objTrusts = ApplicationSecurityManager.UserApplicationTrusts 

For Each objTrust As ApplicationTrust In objTrusts 

Console.WriteLine(objTrust.ApplicationIdentity.FullName.ToString) 

Next 

D. Dim objTrusts As ApplicationTrustCollection 

objTrusts = ApplicationSecurityManager.UserApplicationTrusts 

For Each objTrust As Object In objTrusts 

Console.WriteLine(objTrust.ToString) 

Next 

Answer: