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()
```
b. ```Dim addressFile As System.IO.StreamReader
addressFile = System.IO.File.OpenText(“address.txt”)
strName = addressFile.ReadLine()
strCity = addressFile.ReadLine()
addressFile.Close()
```
You might also like to view...
The ________ of recursion is the number of times a recursive function calls itself.
A) level B) breadth C) type D) depth E) None of the above
What is the “three-clicks” rule?
What will be an ideal response?
In a ____ scam, the recipient is instructed to click a Web link, which opens a Web page that requests an e-mail address and password.
A. phishing B. tracking C. pharming D. spamming
Which of the following system utilities can be used to troubleshoot startup programs or services in Windows?
a. MSConfig b. System Information c. Device Manager d. Command Prompt