System.IO.File.SetLastWriteTimeUtc C# (CSharp) Méthode

SetLastWriteTimeUtc() public static méthode

public static SetLastWriteTimeUtc ( String path, DateTime lastWriteTimeUtc ) : void
path String
lastWriteTimeUtc DateTime
Résultat void
        public static void SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
        {
            String fullPath = Path.GetFullPath(path);
            FileSystem.Current.SetLastWriteTime(fullPath, GetUtcDateTimeOffset(lastWriteTimeUtc), asDirectory: false);
        }

Same methods

File::SetLastWriteTimeUtc ( string path, System lastWriteTimeUtc ) : void

Usage Example

    /// <summary>
    ///     Sets the file's last write time.
    /// </summary>
    /// <param name="path">The path of the file.</param>
    /// <param name="lastWriteTime">A <see cref="DateTime" /> with the file attribute to set.</param>
    /// <exception cref="ArgumentNullException">
    ///     <paramref name="path" /> is <see langword="null" /> (<see langword="Nothing" /> in Visual Basic).
    /// </exception>
    public void SetLastWriteTime(
        string path,
        DateTime lastWriteTime)
    {
        _ = Requires.NotNullOrWhiteSpace(
            path,
            nameof(path));

        FSFile.SetLastWriteTimeUtc(
            path,
            lastWriteTime);
    }
All Usage Examples Of System.IO.File::SetLastWriteTimeUtc