File MembersKentico 8.0 API Reference
The File type exposes the following members.
Constructors

  NameDescription
Public methodFile
Back to Top
Methods

  NameDescription
Public methodAppendAllText(String, String)
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
(Overrides AbstractFile AppendAllText(String, String).)
Public methodAppendAllText(String, String, Encoding)
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
(Overrides AbstractFile AppendAllText(String, String, Encoding).)
Public methodCopy(String, String)
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
(Overrides AbstractFile Copy(String, String).)
Public methodCopy(String, String, Boolean)
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
(Overrides AbstractFile Copy(String, String, Boolean).)
Public methodCreate
Creates or overwrites a file in the specified path.
(Overrides AbstractFile Create(String).)
Public methodCreateText
Creates or overwrites a file for writing UTF-8 encoded text.
(Overrides AbstractFile CreateText(String).)
Public methodDelete
Deletes the specified file. An exception is not thrown if the specified file does not exist.
(Overrides AbstractFile Delete(String).)
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
Public methodExists
Determines whether the specified file exists.
(Overrides AbstractFile Exists(String).)
Protected methodOnlineFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from OnlineObject.)
Public methodGetAccessControl
Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified directory.
(Overrides AbstractFile GetAccessControl(String).)
Public methodGetFileUrl
Returns URL to file. If can be accessed directly then direct URL is generated else URL with GetFile page is generated.
(Overrides AbstractFile GetFileUrl(String, String).)
Public methodOnlineGetHashCode
Serves as a hash function for a particular type.
(Inherited from OnlineObject.)
Public methodGetLastWriteTime
Returns the date and time the specified file or directory was last written to.
(Overrides AbstractFile GetLastWriteTime(String).)
Public methodOnlineGetType
Gets the OnlineType of the current instance.
(Inherited from OnlineObject.)
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
Public methodMove
Moves a specified file to a new location, providing the option to specify a new file name.
(Overrides AbstractFile Move(String, String).)
Public methodOpen
Opens a FileStream on the specified path, with the specified mode and access.
(Overrides AbstractFile Open(String, FileMode, FileAccess).)
Public methodOpenRead
Opens an existing file for reading.
(Overrides AbstractFile OpenRead(String).)
Public methodOpenText
Opens an existing UTF-8 encoded text file for reading.
(Overrides AbstractFile OpenText(String).)
Public methodReadAllBytes
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
(Overrides AbstractFile ReadAllBytes(String).)
Public methodReadAllText(String)
Opens a text file, reads all lines of the file, and then closes the file.
(Overrides AbstractFile ReadAllText(String).)
Public methodReadAllText(String, Encoding)
Opens a text file, reads all lines of the file, and then closes the file.
(Overrides AbstractFile ReadAllText(String, Encoding).)
Public methodSetAttributes
Sets the specified FileAttributes of the file on the specified path.
(Overrides AbstractFile SetAttributes(String, FileAttributes).)
Public methodSetLastWriteTime
Sets the date and time that the specified file was last written to.
(Overrides AbstractFile SetLastWriteTime(String, DateTime).)
Public methodSetLastWriteTimeUtc
Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
(Overrides AbstractFile SetLastWriteTimeUtc(String, DateTime).)
Public methodOnlineToString
Returns a string that represents the current object.
(Inherited from OnlineObject.)
Public methodWriteAllBytes
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllBytes(String,  Byte ).)
Public methodWriteAllText(String, String)
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllText(String, String).)
Public methodWriteAllText(String, String, Encoding)
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllText(String, String, Encoding).)
Back to Top
Extension Methods

  NameDescription
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Back to Top
See Also