Latest MCTS 70-536 Real Exam Download 71-80

Ensurepass

QUESTION 71

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. IsolatedStorageFileStream isoStream;

isoStream = new IsolatedStorageFileStream("Settings.dat", FileMode.Open); string result = new StreamReader(isoStream).ReadToEnd();

B. IsolatedStorageFile isoFile;

isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream; isoStream = new IsolatedStorageFileStream("Settings. dat", FileMode.Open, isoFile); string result = new StreamReader(isoStream).ReadToEnd();

C. IsolatedStorageFileStream isoStream;

isoStream = new IsolatedStorageFileStream("Settings.dat", FileMode.Open); string result = isoStream. ToString();

D. IsolatedStorageFile isoFile;

isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream; isoStream = new IsolatedStorageFileStream("Settings. dat", FileMode.Open, isoFile); string result = isoStream.ToString();

Correct Answer: B


QUESTION 72

You are developing an assembly to access file system. Need to write a segment code to configure CLR stop loading the assembly if file permssion is absent.

A. [FileIOPermission(SecurityAction.RequestOptional, AllLocalFiles = FileIOPermissionAccess.Read)]

B. [FileIOPermission(SecurityAction.RequestMinimum, AllFiles = FileIOPermissionAccess.Read)]

C. [FileIOPermission(SecurityAction.RequestRefuse, AllFiles = FileIOPermissionAccess.Read)]

D. [FileIOPermission(SecurityAction.RequestOptional, AllFiles = FileIOPermissionAccess.Read)]

Correct Answer: B


QUESTION 73

Given the code like this:

while(!loop)

{

//Thread code here Dowork();

}

You need to write more code to class to run DoWork() with 30-second intervals using minimum resources

A. Thread.Sleep(30000)

B. Thread.SpinWait(30000)

C. Thread.QueueUserWorkItem(30000)

D. Thread.SpinWait(30)

Correct Answer: A


QUESTION 74

You create an application for your business partners to submit purchase orders. The application deserializes XML documents sent by your partners into instances of an object named PurchaseOrder.

You need to modify the application so that it collects details if the deserialization process encounters any XML content that fails to map to public members of the PurchaseOrder object.

What should you do?

A. Define and implement an event handler for the XmlSerializer.UnknownNode event.

B. Define a class that inherits from XmlSerializer and overrides the XmlSerialize.FromMappings method.

C. Apply an XmlInclude attribute to the PurchaseOrder class definition.

D. Apply an XmlIgnore attribute to the PurchaseOrder class definition

Correct Answer: A


QUESTION 75

You are developing an application that will deploy by using ClickOnce. You need to test if the application executes properly. You need to write a method that returns the object, which prompts the user to install a ClickOnce application. Which code segment should you use?

A. return ApplicationSecurityManager.ApplicationTrustManager;

B. return AppDomain.CurrentDomain.ApplicationTrust;

C. return new HostSecurityManager();

D. return SecurityManager.PolicyHierarchy();

Correct Answer: A


QUESTION 76

You need to write a code segment that will add a string named strConn to the connection string section of the application configuration file. Which code segment should you use?

A. Configuration myConfig = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.

None);

myConfig.ConnectionStrings.ConnectionStrings.Add( new ConnectionStringSettings("ConnStr1", strConn)); myConfig.Save();

B. Configuration myConfig =ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.

None);

myConfig.ConnectionStrings.ConnectionStrings.Add( new ConnectionStringSettings("ConnStr1", strConn)); ConfigurationManager.RefreshSection( "ConnectionStrings");

C. ConfigurationManager.ConnectionStrings.Add( new ConnectionStringSettings("ConnStr1",strConn)); ConfigurationManager.RefreshSection( "ConnectionStrings");

D. ConfigurationManager.ConnectionStrings.Add( new ConnectionStringSettings("ConnStr1",strConn));

Configuration myConfig = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel. None);

myConfig.Save();

Correct Answer: A


QUESTION 77

You create a DirectorySecurity object for the working directory.

You need to identify the user accounts and groups that have read and write permissions. Which method should you use on the DirectorySecurity object?

A. the GetAuditRules method

B. the GetAccessRules method

C. the AccessRuleFactory method

D. the AuditRuleFactory method

Correct Answer: B


QUESTION 78

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. ApplicationTrustCollection trusts;

trusts = ApplicationSecurityManager.UserApplicationTrusts; foreach (ApplicationTrust trust in trusts)

{

Console.WriteLine(trust.ToString());

}

B. ApplicationTrustCollection trusts;

trusts = ApplicationSecurityManager.UserApplicationTrusts; foreach (ApplicationTrust trust in trusts)

{

Console.WriteLine(trust.ExtraInfo.ToString());

}

C. ApplicationTrustCollection trusts;

trusts = ApplicationSecurityManager.UserApplicationTrusts; foreach (ApplicationTrust trust in trusts)

{

Console.WriteLine(trust.ApplicationIdentity.FullName);

}

D. ApplicationTrustCollection trusts;

trusts = ApplicationSecurityManager.UserApplicationTrusts; foreach (object trust in trusts)

{

Console.WriteLine(trust.ToString());

}

Correct Answer: C


QUESTION 79

You work as an application developer at Contonso.com. You are currently creating a manifest- activated application on the Contonso.com’s intranet using ClickOnce deployment.

The network administrator informs you that each application has to identify its name, version, culture, and requested permissions. You need to ensure that the

application you are creating uses the command line to display the required information. What should you do?

A. Use the following code:

ApplicationSecurityInfo appInfo = new ApplicationSecurityInfo (appDomain.CurrentDomain); Console.Writeline (appInfo.ApplicationID.Name); Console.Writeline (appInfo.ApplicationID.Version);

Console.Writeline (appInfo.ApplicationID.Culture); Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

B. Use the following code:

ApplicationSecurityInfo appInfo = ActivationContext.GetCurrentContext (); Console.Writeline (appInfo.ApplicationID.Name); Console.Writeline (appInfo.ApplicationID.Version);

Console.Writeline (appInfo.ApplicationID.Culture); Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

C. Use the following code:

ApplicationSecurityInfo appInfo = new ApplicationSecurityInfo (appDomain.CurrentDomain. ActivationContext);

Console.Writeline (appInfo.ApplicationID.Name); Console.Writeline (appInfo.ApplicationID.Version); Console.Writeline (appInfo.ApplicationID.Culture); Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

D. Use the following code:

ApplicationSecurityInfo appInfo = ActivationID.GetCurrentApplication (); Console.Writeline (appInfo.ApplicationID.Name); Console.Writeline (appInfo.ApplicationID.Version);

Console.Writeline (appInfo.ApplicationID.Culture); Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

Correct Answer: C


QUESTION 80

You are developing an application that stores data about your company’s sales and technical support teams.

You need to ensure that the name and contact information for each person is available as a single collection when a user queries details about a specific team. You also need to ensure that the data collection guarantees type safety.

Which code segment should you use?

A. Hashtable team = new Hashtable(); team.Add(1, "Hance");

team.Add(2, "Jim");

team.Add(3, "Hanif");

team.Add(4, "Kerim");

team.Add(5, "Alex");

team.Add(6, "Mark");

team.Add(7, "Roger");

team.Add(8, "Tommy");

B. ArrayList team = new ArrayList(); team.Add("1, Hance");

team.Add("2, Jim");

team.Add("3, Hanif");

team.Add("4, Kerim");

team.Add("5, Alex");

team.Add("6, Mark");

team.Add("7, Roger");

team.Add("8, Tommy");

C. Dictionary<int, string> team = new Dictionary<int, string>(); team.Add(1, "Hance"); team.Add(2, "Jim");

team.Add(3, "Hanif");

team.Add(4, "Kerim");

team.Add(5, "Alex");

team.Add(6, "Mark");

team.Add(7, "Roger");

team.Add(8, "Tommy");

D. string[] team = new string[] {"1, Hance", "2, Jim", "3, Hanif", "4, Kerim", "5, Alex", "6, Mark", "7, Roger", "8, Tommy"};

Correct Answer: C

 

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