The following line
Environment.UserName
In debug mode in visual studio returns the identity of the user like I need.
Then when I se
This worked for me. Use Environment.GetEnvironmentVariable("USERNAME") for current Login username.
Link :https://www.c-sharpcorner.com/uploadfile/puranindia/the-environment-class-in-C-Sharp/