How to obtain the user information on the current logon page (domain account)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.