2

ユーザーが認証された後に発生するイベントはありますか (Windows)? Application_Start() で実行していますが、false User.Identity.IsAuthenticated.

私が望むのは、ロールを手動で作成してユーザーに追加することです。

4

2 に答える 2

1

私はこれを使用しました:

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
    if (HttpContext.Current.User != null)
    {
        if (HttpContext.Current.User.Identity.IsAuthenticated)
        {
            if (HttpContext.Current.User.Identity is WindowsIdentity)
            {
                if (string.IsNullOrEmpty(Usuario.Nome))
                {

プロジェクトのプロパティ(プロジェクトでalt + enter)で、WEBをクリックしてNTLM AUTHENTICATIONをチェックしてください

これは私にとってはうまくいきました。HttpContext.Current.User.Identitynull ではなくなりました

于 2014-10-30T15:49:49.967 に答える