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? - (VB.Net) 

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

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

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

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

+ Answer
+ Report
Total Preview: 974

Copyright © 2024. Powered by Intellect Software Ltd