How do I get the current user in an MVC Application? [duplicate]
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: How to get current user in Asp.Net MVC I've tried a bunch of different things, I know I've done it before when I used Webforms, but I can't seem to figure out how to do it in MVC. Membership doesn't work User gives me an IPrincipal or something User.Identity gives me the same type of variable... Anyone know? Is there any GetCurrentUser() method or something similar? 回答1: See Mehrdad's answer here: System.Web.UI