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…
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)- A77% (30)
- C8% (3)
- D15% (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
Community Discussion
No community discussion yet for this question.