The FileInfo
values are only loaded once and then cached. To get the current value, call Refresh()
before getting a property:
f.Refresh();
t = f.LastAccessTime;
Another way to get the current value is by using the static methods on the File
class:
t = File.GetLastAccessTime(path);
More Related Contents:
- “No Overload Method for GetLine” Help (C#) [closed]
- Elevating process privilege programmatically?
- How do I start a process from C#?
- How can I run another application within a panel of my C# program?
- How can I run an EXE program from a Windows Service using C#?
- How to detect Windows shutdown or logoff
- Check for device change (add/remove) events
- Unique file identifier in windows
- Retrieve system uptime using C#
- Write to Windows Application Event Log without event source registration
- In .NET/C# test if process has administrative privileges
- Is there Windows system event on active window changed?
- How to force C# .net app to run only one instance in Windows? [duplicate]
- Log off user from Win XP programmatically in C#
- How to programmatically discover mapped network drives on system and their server names?
- How do I get a list of installed updates and hotfixes?
- How do I determine the true pixel size of my Monitor in .NET?
- C# – How to detect a Windows shutdown/logoff and cancel that action (after asking the user)
- How to delete a file after checking whether it exists
- Change Language in C#
- Determining if a folder is shared in .NET
- Why is infinity printed as “8” in the Windows 10 console?
- Why does Environment.Exit() not terminate the program any more?
- Is there a way to convert a System.IO.Stream to a Windows.Storage.Streams.IRandomAccessStream?
- OraOLEDB.Oracle provider is not registered on the local machine
- How to stop Windows service programmatically
- How do I compute the non-client window size in WPF?
- The type ‘System.IDisposable’ is defined in an assembly that is not referenced
- How do I minimize a WinForms application to the notification area?
- Detect if non DPI-aware application has been scaled/virtualized