Multiple Choice
StreamReader inFile = new StreamReader("name.txt") ;
While ((inValue = inFile.ReadLine() ) != null)
With the above code segment, how could you programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exception thrown?
A) invoke File.Exists( ) before the while loop
B) invoke File.Exists( ) inside the while loop
C) include a try...catch block
D) test for File.Exists( ) instead of null
Correct Answer:

Verified
Correct Answer:
Verified
Q61: To programmatically avoid having a FileNotFoundException or
Q62: Which of the following is an abstract
Q63: Which of the following class has public
Q64: PadRight( ) and PadLeft( ) methods of
Q65: The constructor for the StreamWriter class is
Q67: To invoke File's Copy( ) method to
Q68: The files created using the _ class
Q69: The File, FileInfo, Directory, and DirectoryInfo classes
Q70: Every member of the File class is
Q71: The StreamWriter method(s) that clears all buffers