How to obtain the user information on the current logon page (domain account)
All the information I obtained using the following method is empty:
String userdomain = user. Identity. Name. Trim ();Number of questions: 100, replies: 4Top
1 floor Richard Dhu (endless learning) Back to 10:16:31 score
100
System. Security. Principal. windowsidentity. getcurrent (). Name;
Or
Httpcontext. Current. User. Identity. Name; top
Second floor smileface11 (publisher) Back to 11:13:54 score 0
Thank you for your reply. I have used these two methods. The second method gets a null value. The first method I tried to use two machines to get different results, for example, "dongjie \ ASPnet" and "nt authority \ Network Service" Top
Richard Dhu on the third floor (endless learning) Back to 11:29:59 score 0
This is related to machineconfig. It is also related to webconfig. Generally, the computer name of dongjie \ ASPnet, dongjie \ IUSR _ appears, or a specific user of dongjie \ appears. It's strange to see nt authority \ Network Service. You have to check the information. Top
Smileface11 (publisher) on the 4th floor) Back to 11:32:50 score 0
Thank you! My problem is solved because IIS uses a mix of anonymous login and Windows integration verification.