Write an If clause that determines whether the sequential access file named contacts.txt exists. If the file exists, open the file. If the file does not exist, display the message "File not found" in a Label control called lblMessage.

What will be an ideal response?

If IO.File.Exists("contacts.txt") Then
inFile = IO.File.OpenText("contacts.txt")
Else
lblMessage.Text = "File not found"
End If

Computer Science & Information Technology

You might also like to view...

The INDEX function ________ returns a value from a location in a table or range of cells

A) table B) array C) reference D) name

Computer Science & Information Technology

___________ translates high-level language program into machine language program.

a. An assembler b. A compiler c. CPU d. The operating system

Computer Science & Information Technology