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?

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. Dim objStream As IsolatedStorageFileStreamobjStream = New
    IsolatedStorageFileStream( _
    "Settings.dat", FileMode.Open)Dim result As String = New
    StreamReader(objStream).ReadToEnd

B. Dim objFile As IsolatedStorageFileobjFile =
    IsolatedStorageFile.GetMachineStoreForAssemblyDim objStream As
    IsolatedStorageFileStreamobjStream = New IsolatedStorageFileStream( _
    "Settings.dat", FileMode.Open, objFile)Dim result As String = New
    StreamReader(objStream).ReadToEnd

C. Dim objStream As IsolatedStorageFileStreamobjStream = New
    IsolatedStorageFileStream( _
    "Settings.dat", FileMode.Open)Dim result As String objStream.toString

D. Dim objFile As IsolatedStorageFileobjFile =
    IsolatedStorageFile.GetMachineStoreForAssemblyDim objStream As
    IsolatedStorageFileStreamobjStream = New IsolatedStorageFileStream( _
    "Settings.dat", FileMode.Open, objFile)Dim result As String = objStream.ToString

Answer: B 

No comments:

Post a Comment