当前位置: 首页>>代码示例>>C#>>正文


C# HttpSessionState.Add方法代码示例

本文整理汇总了C#中System.Web.SessionState.HttpSessionState.Add方法的典型用法代码示例。如果您正苦于以下问题:C# HttpSessionState.Add方法的具体用法?C# HttpSessionState.Add怎么用?C# HttpSessionState.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.SessionState.HttpSessionState的用法示例。


在下文中一共展示了HttpSessionState.Add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Crear

        // string nombreUsuario )
        /// <summary>
        /// Crea una sesión de usuario
        /// </summary>
        /// <param name="sesion"></param>
        /// <param name="nombreUsuario"></param>
        public static void Crear(HttpSessionState sesion, 
            BDLigotea.Usuario usuario )
        {
            sesion.Add(LRegistro.SESION_USUARIO, usuario.Nick);
            sesion.Add(LRegistro.SESION_ID, usuario.IdUsuario);

            // Dentro de la clase es igual que
            //sesion.Add(SESION_USUARIO, nombreUsuario);
        }
开发者ID:jotacero,项目名称:ligotea,代码行数:15,代码来源:LRegistro.cs

示例2: Run

        public CommandResult Run(HttpRequestData request, IOptions options, HttpSessionState session)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            string rpEntityId = request.QueryString["rp"].FirstOrDefault().Replace('+', ' ');
            var providerData = options.OpenIDProviders[rpEntityId];
            var urls = new OpenIDUrls(options.RPOptions, request.ApplicationUrl);
            providerData.RegisterClient(options.RPOptions, urls);

            OIDCAuthorizationRequestMessage requestMessage = generateRequestMessage(providerData, urls);
            string requestObject = null;

            if (providerData.Sign && options.RPOptions.SignCertificate != null)
            {
                OIDCAuthorizationRequestMessage rObject = generateRequestObject(providerData, urls, requestMessage.State, requestMessage.Nonce);
                requestObject = JWT.Encode(rObject.SerializeToJsonString(), getCertificateKey(options.RPOptions.SignCertificate), JwsAlgorithm.RS256);
                requestMessage.Request = requestObject;
            }

            if (providerData.Encrypt && options.RPOptions.EncCertificate != null)
            {
                if (requestObject == null)
                {
                    OIDCAuthorizationRequestMessage rObject = generateRequestObject(providerData, urls, requestMessage.State, requestMessage.Nonce);
                    requestObject = rObject.SerializeToJsonString();
                }

                requestObject = JWT.Encode(requestObject, getCertificateKey(options.RPOptions.EncCertificate), JweAlgorithm.RSA1_5, JweEncryption.A128CBC_HS256);
                requestMessage.Request = requestObject;
            }

            session.Add("op", rpEntityId);
            session.Add("nonce", requestMessage.Nonce);
            session.Add("state", requestMessage.State);

            return new CommandResult()
            {
                HttpStatusCode = HttpStatusCode.SeeOther,
                Location = new Uri(providerData.ProviderMatadata.AuthorizationEndpoint + "?" + requestMessage.SerializeToQueryString())
            };
        }
开发者ID:biancini,项目名称:OpenIDConnect-Csharp-Client,代码行数:49,代码来源:AuthenticateCommand.cs

示例3: GetSession

        public static UserSession GetSession(HttpSessionState session)
        {
            // if not there create it
            if (session[sessionIndex] == null)
                session.Add(sessionIndex, new UserSession());

            return (UserSession)session[sessionIndex];
        }
开发者ID:bharathileni,项目名称:ibrworld,代码行数:8,代码来源:UserSession.cs

示例4: GetInstance

 public static SessionData GetInstance(HttpSessionState obj)
 {
     if (null != obj[C_SESSION_OBJ_KEY])
     {
         return (SessionData)obj[C_SESSION_OBJ_KEY];
     }
     else
     {
         obj.Add(C_SESSION_OBJ_KEY, new SessionData());
         return (SessionData)obj[C_SESSION_OBJ_KEY];
     }
 }
开发者ID:monkinone,项目名称:OrderPrinnt,代码行数:12,代码来源:SessionData.cs

示例5: InvalidPasswordAttempts

        public static int InvalidPasswordAttempts(HttpSessionState session, int increment = 0)
        {
            if (session == null)
            {
                return 0;
            }

            int retVal = 0;

            if (session["InvalidPasswordAttempts"] == null)
            {
                retVal = retVal + increment;
                session.Add("InvalidPasswordAttempts", retVal);
            }
            else
            {
                retVal = Conversion.TryCastInteger(session["InvalidPasswordAttempts"]) + increment;
                session["InvalidPasswordAttempts"] = retVal;
            }

            if (increment > 0)
            {
                Log.Warning("{Count} Invalid attempt to sign in from {Host}/{IP} using {Browser}.", retVal, GetUserHostAddress(), GetUserIpAddress(), GetBrowser().Browsers);
            }

            return retVal;
        }
开发者ID:roczj,项目名称:mixerp,代码行数:27,代码来源:PageUtility.cs

示例6: setGtSession

 public void setGtSession(HttpSessionState session)
 {
     session.Add(GeetestLib.gtSessionKey, this);
 }
开发者ID:j717273419,项目名称:gt-csharp-sdk,代码行数:4,代码来源:GeetestLib.cs

示例7: setGtServerStatusSession

 public void setGtServerStatusSession(HttpSessionState session, int statusCode)
 {
     session.Add(GeetestLib.gtServerStatusSessionKey, statusCode);
 }
开发者ID:j717273419,项目名称:gt-csharp-sdk,代码行数:4,代码来源:GeetestLib.cs

示例8: setInfo

 /// <summary>
 /// set a user data
 /// </summary>
 /// <param name="session"></param>
 /// <param name="data"></param>
 /// <returns></returns>
 public static HttpSessionState setInfo(HttpSessionState session, Data data)
 {
     session.Add(sName, data);
     return session;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:11,代码来源:UserInfo.cs

示例9: GenerateChallenge

 public static string GenerateChallenge(HttpSessionState session)
 {
     string challenge = GenerateChallenge();
     session.Add(ChallengeSessionKey, challenge);
     return challenge;
 }
开发者ID:kiniry-supervision,项目名称:OpenNemID,代码行数:6,代码来源:ChallengeGenerator.cs

示例10: DefAppWebAdmin

 /// <summary>
 /// Default Constructor
 /// </summary>
 public DefAppWebAdmin(HttpSessionState session)
 {
     _innerSession = session;
     _innerSession.Add(DefAppWebAdmin.DEFAPPNAME, this);
 }
开发者ID:asr340,项目名称:owasp-code-central,代码行数:8,代码来源:DefAppWebAdmin.cs


注:本文中的System.Web.SessionState.HttpSessionState.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。