nerdexam
Microsoft

98-372 · Question #220

Which two classes in the .NET Framework can you use to open a file? (Each correct answer presents a complete solution. Choose two.)

The correct answer is A. System.IO.FileInfo B. System.IO.File. A: System.IO.FileInfo provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. B: System.IO.File provides static methods for the creation, copying, deletion, moving, and opening…

Understanding Namespaces and Classes

Question

Which two classes in the .NET Framework can you use to open a file? (Each correct answer presents a complete solution. Choose two.)

Options

  • ASystem.IO.FileInfo
  • BSystem.IO.File
  • CSystem.IO.Path
  • DSystem.IO.Stream

How the community answered

(39 responses)
  • A
    77% (30)
  • C
    8% (3)
  • D
    15% (6)

Explanation

A: System.IO.FileInfo provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. B: System.IO.File provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. Not D: System.IO.FileStream exposes a Stream around a file, supporting both synchronous and asynchronous read and write operations.

Topics

#System.IO#FileInfo#File class#file operations

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice