VB.Net FileInfo.LastAccessTime not working on share

Hi to all,

I have a small VB.Net application that needs to collect file information from a share on our domain. I have noticed that the file's last access time is not correct if the file is on the share. If I copy the file to my local system the information returned is correct.

What is causing the issue? Is my code correct?

Thanks

Dim FileInfo As New IO.FileInfo(FileNameHere)

If FileInfo IsNot Nothing Then
               
Dim strLastModified As String = System.IO.File.GetLastWriteTime(convertedfile.ToString()).ToShortDateString()

End If

Open in new window

ALawrence007Asked:
Who is Participating?
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
UnifiedISCommented:
Is it off by x number of hours like a time zone thing?
0
 
ALawrence007Author Commented:
No, it comes back with a date of "12/31/1600". Not correct
0
 
ALawrence007Author Commented:
That was the issue.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.