Click or drag to resize

FileInfo Class

Provides an instance for the creation, copying, deletion, moving, and opening of files.
Inheritance Hierarchy
SystemObject
  Crestron.SimplSharp.CrestronIOFileSystemInfo
    Crestron.SimplSharp.CrestronIOFileInfo

Namespace: Crestron.SimplSharp.CrestronIO
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public sealed class FileInfo : FileSystemInfo

The FileInfo type exposes the following members.

Constructors
 NameDescription
Public methodFileInfo Initialize the FileInfo class with the specified file name.
Top
Properties
 NameDescription
Public propertyAttributes Gets or sets the FileAttributes of the current object.
(Overrides FileSystemInfoAttributes)
Public propertyCreationTime Gets the creation time of the current object.
(Overrides FileSystemInfoCreationTime)
Public propertyDirectory Return the DirectoryInfo for the parent directory.
Public propertyDirectoryName Return the the directory's name.
Public propertyExists Determines if the file exists on the system.
(Overrides FileSystemInfoExists)
Public propertyExtension Gets the string representing the extension part of the file.
(Overrides FileSystemInfoExtension)
Public propertyFullName Return the full name of the file path
(Overrides FileSystemInfoFullName)
Public propertyLastAccessTime Gets or sets the time the current file or directory was last accessed.
(Overrides FileSystemInfoLastAccessTime)
Public propertyLastWriteTime Gets or sets the time when the current file or directory was last written to.
(Overrides FileSystemInfoLastWriteTime)
Public propertyLength Return the the length of the file, in bytes.
Public propertyName Return the name of file.
(Overrides FileSystemInfoName)
Top
Methods
 NameDescription
Public methodCode exampleAppendText Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.
Public methodCopyTo(String) Copies the specified file to a new file location.
Public methodCopyTo(String, Boolean) Copies the specified file to a new file location with the option to overwrite.
Public methodCode exampleCreate Creates a file.
Public methodCode exampleCreateText Creates a StreamWriter that writes a new text file.
Public methodDelete Delete the file.
(Overrides FileSystemInfoDelete)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodMoveTo Moves the specified file to the destination with possibly a new file name.
Public methodCode exampleOpen(FileMode) Opens a file in the specified mode.
Public methodOpen(FileMode, FileAccess) Opens the current file with the specified mode and access.
Public methodOpen(FileMode, FileAccess, FileShare) Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
Public methodOpenRead Opens the current file with Read only access.
Public methodCode exampleOpenText Creates a StreamReader with UTF8 encoding that reads from an existing text file.
Public methodOpenWrite Opens the current file with write only access.
Public methodRefresh Refreshes the state of the object.
(Overrides FileSystemInfoRefresh)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also