Chia sẻ

The SetLastAccessTime and GetLastAccessTime methods are used to set and get the last access date and time of the specified directory. The following code snippet sets and gets the last access date and time of a directory.

string root = @"C:Temp";
// Get and Set Last Access time
Directory.SetLastAccessTime(root, DateTime.Now);
DateTime lastAccessTime = Directory.GetLastAccessTime(root);
Console.WriteLine(lastAccessTime);

 

ĐĂ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 *