C# DirectoryInfo LastWriteTime

Description

DirectoryInfo LastWriteTime Gets or sets the time when the current file or directory was last written to.

Syntax

DirectoryInfo.LastWriteTime has the following syntax.


public DateTime LastWriteTime { get; set; }

Example

Gets the time when the current file or directory was last written to.


using System;/*w  w  w.  j  av a  2s  .c  o m*/
using System.IO;

class Class1
{
   public static void Main(){
      DirectoryInfo  target = new DirectoryInfo("c:/abc");
      Console.WriteLine(target.LastWriteTime);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter