I've created the method below to return the name of the user logged onto the PC. ex: john.doe
Works great when running from my own PC. But when we put the code on our server and run it, the method returns a value of "NETWORK SERVICE" regardless of who runs the web page from their PC.
I need to know who is logged onto the site because that is used in the functionality of the site (ex: record who made changes to data, etc.)
Thanks in advance for help,
public static string GetWindowsName()
domainUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
NameArray = domainUser.Split('\\');
NameArray = User.Identity.Name.Split('\\');