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
Q41: Which method, used with the StreamWriter class,
Q45: BinaryReader and BinaryWriter classes _.
A) expose only
Q47: Assume that an object of the DirectoryInfo
Q49: The gray section below the Form object
Q54: Objects of streams can be wrapped with
Q59: If a StreamReader object named reader is
Q61: The _ class makes it easy to
Q63: A(n) _ is considered a named collection
Q66: A(n) _ is a special form of
Q72: NET Framework includes the _ namespace, which
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