Which of the following code segments will read the following two lines from addressFile and place the data in two variables named strName, and strCity? Bob Johnson
Somewhere USA
A) Dim addressFile As System.IO.StreamReader addressFile = System.OpenText("address.txt")
StrName = addressFile.ReadLine()
StrCity = addressFile.ReadLine()
AddressFile.Close()
B) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText("address.txt")
StrName = addressFile.ReadLine()
StrCity = addressFile.ReadLine()
AddressFile.Close()
C) Dim addressFile As System.IO.StreamReader addressFile = OpenText("address.txt")
StrName = ReadLine(addressFile)
StrCity = ReadLine(addressFile)
Close()
D) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText("address.txt")
StrName = addressFile.Input()
StrCity = addressFile.Input()
Close()
Correct Answer:
Verified
Q1: To left justify the columns in the
Q2: Identify the following statements which will: Format
Q4: Visual Basic allows you to use a(n)
Q5: Which of the following statements are not
Q6: When the PrintDocument control's Print method is
Q7: This control is used to display a
Q8: The StreamReader object's _is used to determine
Q9: The _method displays a dialog window when
Q10: The StreamWriter's CreateText method will _.
A) create
Q11: When a file is selected from an
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents