how can i determine the file size and the date it was last modified..
i need to compare two files and determine which one is the latest and which one is bigger in file size..
compare a.xml to b.xml..
Printable View
how can i determine the file size and the date it was last modified..
i need to compare two files and determine which one is the latest and which one is bigger in file size..
compare a.xml to b.xml..
Use FileInfo property...
VB.Net Code:
'in method (let say on button click or similar) Dim aFile As New IO.FileInfo aFile = My.Computer.FileSystem.GetFileInfo("test.txt") 'you will probably browse this file name and not like this sample, fixed it in code here... Dim FileSize As Long = aFile.Length MsgBox(FileSize)
and for date you can use the same property...
VB.Net Code:
MsgBox("Accessed: " & fileDetail.LastAccessTime) 'or MsgBox("Modified: " & fileDetail.LastWriteTime)
thanks..
np...
...please mark this thread resolved.