98-372 · Question #135
Which two classes in the .NET Framework allow you to delete a file? (Each correct answer presents a complete solution. Choose two.)
The correct answer is B. System.IO.File D. System.IO.FileInfo. D: 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 allow you to delete a file? (Each correct answer presents a complete solution. Choose two.)
Options
- ASystem.IO.FileStream
- BSystem.IO.File
- CSystem.IO.Stream
- DSystem.IO.FileInfo
- ESystem.IO.Path
How the community answered
(55 responses)- A15% (8)
- B73% (40)
- C4% (2)
- E9% (5)
Explanation
D: 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 A: 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.