Option A)
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
- Returns: NetworkName\Username
- Gets the user's Windows logon name.
- Details: https://learn.microsoft.com/en-us/dotnet/api/system.security.principal.windowsidentity