PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
IsolatedStrongFile store;
store = IsolatedStorageFile.GetUserStoreForAssembly();
store.CreateDirectory(“Preferences”);

B.
IsolatedStrongFile store;
store = IsolatedStorageFile.GetStoreForAssembly();
store.CreateDirectory(“Preferences”);

C.
IsolatedStrongFile store;
store = IsolatedStorageFile.GetUserStoreForDomain();
store.CreateDirectory(“Preferences”);

D.
IsolatedStrongFile store;
store = IsolatedStorageFile.GetMachineStoreForApplication();
store.CreateDirectory(“Preferences”);

Explanation:
The user store for the assembly is the correct store that is required. It is returned by IsolatedStorageFile.GetUserStoreForAssembly().
B,C & D return Isolated Storage File stores of incorrect scope

One Comment on “Which code segment should you use?


Leave a Reply