How can I get the user name of Windows Login? I used these methods:
But, when I PUT this inside IIS server, it takes the name of the server, not my machine.
GetCurrent(). Name; Returns: NetworkName\Username.
Click on the Start button. Right-click on Computer. Select Properties. Under Computer name, domain, and workgroup settings you will find the computer name listed.
Try Page.User.Identity.Name
. This should be what you're looking for. This property is derived from HttpContext
and represents the logged in user security information for the current HTTP request.
If the result is null, then I would suspect that the IIS settings is not configured properly. Try the advice in the following links:
http://forums.asp.net/t/1689878.aspx/1
HttpContext.Current.User.Identity.Name is Empty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With