We use the bottom line to get the date and time of the last access to the file.
DateTime dtLastAccesstime = File.GetLastAccessTime(sFilePath);
But we face a strange problem, this call itself changes the last access time. Thus, we get the current time as the last access time.
source
share