本文整理汇总了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);
}
示例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())
};
}
示例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];
}
示例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];
}
}
示例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;
}
示例6: setGtSession
public void setGtSession(HttpSessionState session)
{
session.Add(GeetestLib.gtSessionKey, this);
}
示例7: setGtServerStatusSession
public void setGtServerStatusSession(HttpSessionState session, int statusCode)
{
session.Add(GeetestLib.gtServerStatusSessionKey, statusCode);
}
示例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;
}
示例9: GenerateChallenge
public static string GenerateChallenge(HttpSessionState session)
{
string challenge = GenerateChallenge();
session.Add(ChallengeSessionKey, challenge);
return challenge;
}
示例10: DefAppWebAdmin
/// <summary>
/// Default Constructor
/// </summary>
public DefAppWebAdmin(HttpSessionState session)
{
_innerSession = session;
_innerSession.Add(DefAppWebAdmin.DEFAPPNAME, this);
}