Here's a code snippet that uses the FileInfo
class from the System.IO
namespace to get the last modified date of a JSON file in C#:
main.cs315 chars12 lines
Replace "path/to/file.json"
with the actual file path of the JSON file you want to get the last modified date of. The FileInfo
class provides a LastWriteTime
property which returns a DateTime
object representing the last time the file was modified.
gistlibby LogSnag