Ensurepass

QUESTION 21

You need to identify a type that meets the following criteria:

稩s always a number.

稩s not greater than 65,535. Which type should you choose?

A. System.UInt16

B. int

C. System.String

D. System.IntPtr

Correct Answer: A


QUESTION 22

You are writing code for user authentication and authorization. The username, password, and roles are stored in your application data store. You need to establish a user security context that will be used for authorization checks such as IsInRole.

You write the following code segment to authorize the user. if (!TestPassword(userName, password))

throw new Exception("could not authenticate user"); String[] userRolesArray = LookupUserRoles(userName);

You need to complete this code so that it establishes the user security context. Which code segment should you use?

A. GenericIdentity ident = new GenericIdentity(userName);

GenericPrincipal currentUser = new GenericPrincipal(ident, userRolesArray); Thread.CurrentPrincipal = currentUser;

B. WindowsIdentity ident = new WindowsIdentity(userName);

WindowsPrincipal currentUser = new WindowsPrincipal(ident); Thread.CurrentPrincipal = currentUser;

C. NTAccount userNTName = new NTAccount(userName);

GenericIdentity ident = new GenericIdentity(userNTName.Value); GenericPrincipal currentUser = new GenericPrincipal(ident, userRolesArray); Thread. CurrentPrincipal = currentUser;

D. IntPtr token = IntPtr.Zero;

token = LogonUserUsingInterop(username,encryptedPassword); WindowsImpersonationContext ctx = WindowsIdentity.Impersonate(token);

Correct Answer: A


QUESTION 23

You are developing an application that will perform mathematical calculations. You need to ensure that the application is able to perform multiple calculations simultaneously. What should you do?

A. Set the IdealProcessor property of the ProcessThread object.

B. Set the ProcessorAffinity property of the ProcessThread object.

C. For each calculation, call the QueueUserWorkItem method of the ThreadPool class.

D. Set the Process.GetCurrentProcess().BasePriority property to High.

Correct Answer: C


QUESTION 24

You are creating a strong-named assembly named Company1 that will be used in multiple applications.

Company1 will be rebuilt frequently during the development cycle. You need to ensure that each time the assembly is rebuilt it works correctly with each application that uses it. You need to configure the computer on which you develop Company1 such that each application uses the latest build of Company1.

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

A. Create a DEVPATH environment variable that points to the build output directory for the strong named assembly.

B. Add the following XML element to the machine configuration file:

<dependentAssembly>

<assemblyIdentity name="Assembly1" publicKeyToken="32ab4ba45e0a69a1" language="en- US" version="*.*.*.*" />

<publisherPolicy apply="no" />

</dependentAssembly>

C. Add the following XML element to the configuration file of each application that uses the strong- named assembly:

<supportedRuntime version="*.*.*.*" />

D. Add the following XML element to the machine configuration file:

<developmentMode developerInstallation="true"/>

E. Add the following XML element to the configuration file of each application that uses the strong- named assembly:

<dependentAssembly>

<assemblyIdentity name="Assembly1" publicKeyToken="32ab4ba45e0a69a1" language="en- US" version="*.*.*.*" />

<bindingRedirect newVersion="*.*.*.*"/>

</dependentAssembly>

Correct Answer: AD


QUESTION 25

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.

Correct Answer: BF


QUESTION 26

You develop a service application that needs to be deployed. Your network administrator creates a specific user account for your service application.

You need to configure your service application to run in the context of this specific user account. What should you do?

A. Prior to installation, set the StartType property of the ServiceInstaller class.

B. Prior to installation, set the Account, Username, and Password properties of the ServiceProcessInstaller class.

C. Use the CONFIG option of the net.exe command-line tool to install the service.

D. Use the installutil.exe command-line tool to install the service.

Correct Answer: B


QUESTION 27

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. [OnSerializing]internal void UpdateValue(SerializationInfo info) { info.AddValue("currentRate", GetCurrentRate());

}

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

}

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

}

Correct Answer: D


QUESTION 28

You are writing an application that uses isolated storage to store user preferences. The application uses multiple assemblies. Multiple users will use this application on the same computer.

You need to create a directory named Preferences in the isolated storage area that is scoped to the current Microsoft Windows identity and assembly. Which code segment should you use?

A. IsolatedStorageFile store;

store = IsolatedStorageFile.GetUserStoreForAssembly(); store.CreateDirectory("Preferences");

B. IsolatedStorageFile store;

store = IsolatedStorageFile.GetMachineStoreForAssembly(); store.CreateDirectory("Preferences");

C. IsolatedStorageFile store;

store = IsolatedStorageFile.GetUserStoreForDomain(); store.CreateDirectory("Preferences");

D. IsolatedStorageFile store;

store = IsolatedStorageFile.GetMachineStoreForApplication(); store.CreateDirectory("Preferences");

Correct Answer: A


QUESTION 29

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>

Correct Answer: B


QUESTION 30

You are loading a new assembly into an application.

You need to override the default evidence for the assembly.

You require the common language runtime (CLR) to grant the assembly a permission set, as if the assembly were loaded from the local intranet zone. You need to build the evidence collection.

Which code segment should you use?

A. Evidence evidence = new Evidence(); Assembly.GetExecutingAssembly().Evidence);

B. Evidence evidence = new Evidence(); evidence.AddAssembly(new Zone(SecurityZone.Intranet));

C. Evidence evidence = new Evidence(); evidence.AddHost(new Zone(SecurityZone.Intranet));

D. Evidence evidence = new Evidence(AppDomain.CurrentDomain.Evidence);

Correct Answer: C

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

Comments are closed.