Hier die VB.net umwandlung von ganymedes Snippet:
http://dotnet-snippets.de/dns/file-owner--file-besitzer-SID1062.aspx
Zitat: Liest den Besitzer eines Files aus
Public Function FileOwner2(ByVal Fi As System.IO.FileInfo) As String
'File.GetAccessControl(@"C:\test.txt")).GetOwner(typeof(NTAccount))
Dim ds As Security.AccessControl.FileSecurity = Fi.GetAccessControl
Dim ir As Security.Principal.IdentityReference = ds.GetOwner(GetType(Security.Principal.NTAccount))
Return ir.Value.ToString
End Function
Kommentare zum Snippet