Question:You need to read the entire contents of a file named Message.txt into a single string variable. Which code segment should you use? 

A Dim result As String = string.Empty
Dim reader As New StreamReader("Message.txt")
While Not reader.EndOfStream
result &= reader.ToString()
End While 

B Dim result As String = Nothing
Dim reader As New StreamReader("Message.txt")
result = reader.Read().ToString() 

C Dim result As String = Nothing
Dim reader as New StreamReader("Message.txt")
result = reader.ReadToEnd() 

D Dim result as String = Nothing
Dim reader As New StreamReader("Message.txt")
result = reader.ReadLine() 

+ Answer
+ Report
Total Preview: 1236

Copyright © 2024. Powered by Intellect Software Ltd