I know I've done this in the past, but it was a long time ago (2005-2006). I'm trying to get the user that is currently logged into the local machine (their username).
I have this code:
string strUsername = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
which is currently showing: NT AUTHORITY\NETWORK SERVICE
I have the web.config set up:
<authentication mode="Windows"/><identity impersonate="true" />
When I go into IIS and turn off anonymous authentication, then I'm getting an error that I do not have access to this page. I can't find what I'm missing.
Thanks for your help!
Josh