Below is the code how to get the name of the file's owner:
using System.Security.AccessControl;
using System.Security.Principal;
using System.IO;
//...
FileInfo fileInfo = new FileInfo(@"1.txt");
FileSecurity fileSecurity = fileInfo.GetAccessControl();
IdentityReference identityReference = fileSecurity.GetOwner(typeof(NTAccount));
MessageBox.Show(identityReference.Value);
Is it possible to write this data to the file using c#?