1

User.Identity.NameASP.NET MVC 4 では、との違いは何 WebSecurity.CurrentUserNameですか? 互換的に使用できますか?

4

1 に答える 1

5

リフレクターの礼儀:

public static class WebSecurity
{
    ...

    public static string CurrentUserName
    {
        get
        {
            return Context.User.Identity.Name;
        }
    }

    ...
}     

それでは、あなたの質問に答えましょう:

User.Identity.Nameとはどう違いWebSecurity.CurrentUserNameますか?

なし。

互換的に使用できますか?

はい。

于 2013-02-03T18:28:27.507 に答える