These are the codes that I have tried
Dim myDirectory As new.IO.DirectoryInfo("C:\MyFolder")
Dim myFiles() As String = myDirectory.GetFiles.OrderByDescending(Function(x) x.LastWriteTime).Select(Function(x) x.FullName).Take(40).ToArray
MsgBox(String.Join(Environment.NewLine, myFiles)
Here since I am giving Take(40), it will be taking only last 40files, but I want which can take all files which are modifies in last 24hrs(it may be 100 or 1000)