nerdexam
Microsoft

98-372 · Question #50

Allen is creating an application using .NET Framework 4.0. He needs a utility class to provide static methods to create, copy, delete, move, and open files. Which utility class will he use?

The correct answer is B. File. The File class is an utility class that is used to provide static methods to create, copy, delete, move, and open files. It is used to provide support in the creation of FileStream objects. It can also be used to get and set file attributes or DateTime information related to…

Understanding Namespaces and Classes

Question

Allen is creating an application using .NET Framework 4.0. He needs a utility class to provide static methods to create, copy, delete, move, and open files. Which utility class will he use?

Options

  • AFileAccess
  • BFile
  • CFileMode
  • DFileShare

How the community answered

(35 responses)
  • A
    3% (1)
  • B
    83% (29)
  • C
    11% (4)
  • D
    3% (1)

Explanation

The File class is an utility class that is used to provide static methods to create, copy, delete, move, and open files. It is used to provide support in the creation of FileStream objects. It can also be used to get and set file attributes or DateTime information related to the creation, access, and writing of a file. It is more efficient to use the methods of the File class when only one task is to be performed. All methods of the File class require a specified path to the file that is to Answer: A is incorrect. The FileAccess enumeration is used to specify read and write access to a Answer: D is incorrect. The FileShare enumeration is used to specify the level of access permitted for a file that is already in use. Answer: C is incorrect. The FileMode enumeration is used to specify whether the contents of an existing file are preserved/overwritten, and whether requests to create an existing file cause an

Topics

#File class#static methods#file operations#System.IO

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice