Unlike the file class, the FileInfo class does not have a static method and can be used only for instantiated pairs of images. FileInfo to files that are represented on a disk or network location, note that it is not a stream, and in order to read and write files, you must create a stream pair image.
The FileInfo class provides the following properties about the underlying file that may be used to update the file.
Attributes-----Gets or sets the properties of the current file
CreationTime------Gets the date and time the current file was created
directoryname------Get the path to the file directory
Exists------Determine if a file exists
FullName------Retrieving the full path of a file
Length------Get the file's capacity
Name------simply returns the name of the file, not the full file location path,
When in. NET code, you can use either an absolute pathname or a relative path name. An absolute pathname explicitly specifies where the file or directory comes from-a known location-such as a C: drive. Its-an example is C:\work\LogFile. Txt. Note that it clearly defines its position.
Relative pathname to the location where the application is running on the file system. By using a relative path name, there is no need to specify a known drive or location; The current directory is the starting point. For example, if the application is running on the C:\DeVelopment\FileDemo directory (where the application refers to the code-generated EXE file) and uses the relative path "LogFile". TXT, "then the file is located in C:\DeVelopment\FileDemo\LogFile.txt. In order to move the directory up, use the: Character. In this way, in the same application path ". /test.txt "is a file test.txt that points to the top-level directory in the directory where the application resides.
C # FileInfo Class