How to get Last saved by of a file
Thank you in advance.
The below query will get you a single file which is last saved in a directory.
Directory.GetFiles("yourDirectoryPath").[Select](Function(f) New FileInfo(f)).OrderByDescending(Function(fi) fi.LastWriteTime).First().ToString
I want to know name of account who save file not modify time, seem to get who modify it using not using System.IO.FileInfo.
Okay, then try with the below query, it will give you the username of the last modified file in a directory
Directory.GetFiles("yourDirectoryPath").[Select](Function(f) New FileInfo(f)).OrderByDescending(Function(fi) fi.LastWriteTime).First.GetAccessControl().GetOwner(GetType(System.Security.Principal.NTAccount)).ToString()
2 Likes
After i try it output was my Computer name
I want file information below picture
Do you have any suggestion?
Please find the working sample file LastSavedBy.xaml (5.4 KB)
It requires Spire.XLS
Package. This workflow works for Excel Files only, if you want to work with other Docs, then switch to the other Spire
Package.
Cheers @pondyondaime
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.