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

B Dim objFile As IsolatedStorageFile
objFile = IsolatedStorageFile.GetMachineStoreForAssembly Dim objStream As
IsolatedStorageFileStream
objStream = New IsolatedStorageFileStream( _
"Settings.dat", FileMode.Open, objFile)
Dim result As String = objStream.ToString 

C Dim objFile As IsolatedStorageFile
objFile = IsolatedStorageFile.GetMachineStoreForAssembly Dim objStream As
IsolatedStorageFileStream
objStream = New IsolatedStorageFileStream( _
"Settings.dat", FileMode.Open, objFile)
Dim result As String = New StreamReader(objStream).ReadToEnd 

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

+ Answer
+ Report
Total Preview: 790

Copyright © 2024. Powered by Intellect Software Ltd