Specifies the level of access permitted for a file that is already in use. Specifies read and write access to a file. The following table describes the enumerations that are used to customize the behavior of various FileInfo methods. For more information, see specific FileInfo members such as Open, OpenRead, OpenText, CreateText, or Create.īy default, full read/write access to new files is granted to all users. You can use these other types to further manipulate a file. Many of the FileInfo methods return other I/O types when you create or open files. If you are performing multiple operations on the same file, it can be more efficient to use FileInfo instance methods instead of the corresponding static methods of the File class, because a security check will not always be necessary. Use the FileInfo class for typical operations such as copying, moving, renaming, creating, opening, deleting, and appending to files. HelloĬ:\Users\userName\AppData\Local\Temp\tmp70AB.tmp was copied to C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp.Ĭ:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted. This example produces output similar to the following. using namespace System Ĭonsole::WriteLine( ".") On subsequent calls, you must call Refresh to get the latest copy of the information. When the properties are first retrieved, FileInfo calls the Refresh method and caches information about the file. The following example demonstrates some of the main members of the FileInfo class. SerializableAttribute ComVisibleAttribute Examples
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |