How can we get the local file date example chethan.pdf or chethan.txt

hello family,
how can I get the file info like the date?
@Yoichi
Can anyone tell me, please

Thanks
Chethan P

Hi,

There are 2 ways to achieve it.

  1. Use System.IO.File class. such as System.Io.File.GetLastWriteTime method
  1. Use FileInfo class

for example

fi = new FileInfo("C:\temp\test.txt")

then, fi.LastAccessTime returns last access time

Regards,

1 Like