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
Q39: StreamReader inFile = new StreamReader("name.txt"); while ((inValue
Q40: When you place an @ in front
Q41: Which method, used with the StreamWriter class,
Q42: Which method is used to cause the
Q43: The StreamReader class extends the _ class.
A)
Q45: BinaryReader and BinaryWriter classes _.
A) expose only
Q46: Parent and Root are two key properties
Q47: Assume that an object of the DirectoryInfo
Q48: When writing text files, if you add
Q49: The gray section below the Form object
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