本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.GetInt32Value方法的典型用法代码示例。如果您正苦于以下问题:C# NameValueCollection.GetInt32Value方法的具体用法?C# NameValueCollection.GetInt32Value怎么用?C# NameValueCollection.GetInt32Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.NameValueCollection
的用法示例。
在下文中一共展示了NameValueCollection.GetInt32Value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Initializes the provider with the specified values.
/// </summary>
/// <param name="name">The name of the provider.</param>
/// <param name="configValue">Provider specific attributes.</param>
public override void Initialize(string name, NameValueCollection configValue)
{
base.Initialize(name, configValue);
ServiceName = configValue.GetStringValue("serviceName", "");
ServiceMachineName = configValue.GetStringValue("serviceMachineName", "");
OutputFileNameToWatch = configValue.GetStringValue("outputFileNameToWatch", "");
OutputFileExpectedAgeMinutes = configValue.GetInt32Value("outputFileExpectedAgeMinutes", 0);
OutputFileMaxAgeMinutes = configValue.GetInt32Value("outputFileMaxAgeMinutes", 60);
AssertConfigurationValid();
}
示例2: InitializeInternal
private void InitializeInternal(string name, NameValueCollection configValue)
{
base.Initialize(name, configValue);
NameRegexExpression = configValue.GetStringValue("nameRegexExpression", "^([a-zA-Z0-9\\-_\\s])*$");
EmailRegexExpression = configValue.GetStringValue("emailRegexExpression",
"^([0-9a-zA-Z]+[-\\._+&]*)*[0-9a-zA-Z][email protected]([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$");
PasswordRegexExpression = configValue.GetStringValue("passwordRegexExpression", "^([[email protected]*#]{6,128})$");
PasswordErrorMessage = configValue.GetStringValue("passwordErrorMessage",
"The password must be between 6 and 32 characters long; and can only contain letters, numbers, and these special symbols(@, *, #)");
BaseHashIterations = configValue.GetInt32Value("baseHashIterations", 5000);
HashGroupMinimum = configValue.GetInt32Value("hashGroupMinimum", 1);
HashGroupMaximum = configValue.GetInt32Value("hashGroupMaximum", 1000);
ExtendedSessionDuration = configValue.GetInt32Value("extendedSessionDuration", 20160); //20160=2weeks
PublicSessionDuration = configValue.GetInt32Value("publicSessionDuration", 20); //20 minutes default.
PasswordResetCodeExpirationHours = configValue.GetInt32Value("PasswordResetCodeExpirationHours", 1);
GuestUserExpirationDays = configValue.GetInt32Value("GuestUserExpirationDays", 14);
_hashProviderName = configValue.GetStringValue("hashProviderName", String.Empty);
if (!string.IsNullOrEmpty(_hashProviderName))
{
// ReSharper disable NotResolvedInText
if (HashManager.Providers[_hashProviderName] == null)
throw new ArgumentOutOfRangeException("hashProviderName", _hashProviderName,
"The specified HashProviderName does not exist.");
// ReSharper restore NotResolvedInText
}
PasswordExpiration = configValue.GetInt32Value("passwordExpiration", PasswordExpiration);
LoginExceededFailureMessage = configValue.GetStringValue("loginExceededFailureMessage",
"Too many recent failed attempts have been made for this name. " +
"Either you entered the wrong password or an account by this name does not exist. " +
"If this is your account, try again later or email support with your problem. " +
"For security do not include your password in any email.");
LoginCredentialsFailureMessage = configValue.GetStringValue("loginCredentialsFailureMessage",
"The supplied name or password is incorrect.");
FailurePeriodMinutes = configValue.GetInt32Value("failurePeriodMinutes", 20);
AllowedFailuresPerPeriod = configValue.GetInt32Value("allowedFailuresPerPeriod", 5);
String impersonateRoles = configValue.GetStringValue("impersonationAllowedRoles", "Administrator");
ImpersonationAllowedRoles = !String.IsNullOrEmpty(impersonateRoles)
? impersonateRoles.Split(';', ',')
: new string[] { };
}