Chia sẻ

The SetLastWriteTime and GetLastWriteTime methods are used to set and get the last write date and time of the specified directory. The following code snippet sets and gets the last write date and time of a directory.

string root = @"C:Temp";
// Get and Set Last Write time
Directory.SetLastWriteTime(root, DateTime.Now);
DateTime lastWriteTime = Directory.GetLastWriteTime(root);
Console.WriteLine(lastWriteTime);

 

 

ĐĂNG KÝ MUA HÀNG

    Email (*)

    Điện thoại (*)

    Tên sản phẩm/Dịch vụ:


    Chia sẻ
    Xem thêm  [C#] How to Copy a File in C#

    Leave a Reply

    Your email address will not be published. Required fields are marked *