Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function LastAccessedFile(ByVal strDir As String) As String
Dim strRes As String [green]' path to last file accessed[/green]
Dim tLast As DateTime [green]' time of last access[/green]
Dim tCur As DateTime [green]' last access time of current file in the loop[/green]
For Each strFile As String In Directory.GetFiles(strDir)
[green]' get the curent file's last access time[/green]
tCur = File.GetLastAccessTime(strFile)
[green]' grab the current file if this is the first iteration
' or if it has the most recent access date so far[/green]
If (tCur > tLast OrElse strRes Is Nothing) Then
strRes = strFile
tLast = tCur
End If
Next
Return strRes
End Function