[SIZE=3][COLOR=#0000ff]private[/COLOR] [COLOR=#0000ff]string[/COLOR] GetFileOwner([COLOR=#0000ff]string[/COLOR] path)[/SIZE]
[SIZE=3]{[/SIZE]
[SIZE=3]ManagementObject mgmt = [COLOR=#0000ff]new[/COLOR] ManagementObject("Win32_LogicalFileSecuritySetting .path='" + path + "'");[/SIZE]
[SIZE=3]ManagementBaseObject secDesc = mgmt.InvokeMethod("GetSecurityDescriptor",[COLOR=#0000ff]null[/COLOR],[COLOR=#0000ff]null[/COLOR]);[/SIZE]
[SIZE=3]ManagementBaseObject descriptor = secDesc.Properties["Descriptor"].Value [COLOR=#0000ff]as[/COLOR] ManagementBaseObject;[/SIZE]
[SIZE=3]ManagementBaseObject owner = descriptor.Properties["Owner"].Value [COLOR=#0000ff]as[/COLOR] ManagementBaseObject;[/SIZE]
[SIZE=3][COLOR=#0000ff]return[/COLOR] owner.Properties["Domain"].Value.ToString() + "\\" + owner.Properties["Name"].Value.ToString();[/SIZE]
[SIZE=3]}[/SIZE]