GetUserName

[DllImport("Advapi32.dll", SetLastError = true)]
public static extern bool GetUserName(
   StringBuilder lpBuffer,
   ref uint nSize
);

Microsoft documentation: Link

Last updated