本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.IsNull方法的典型用法代码示例。如果您正苦于以下问题:C# NameValueCollection.IsNull方法的具体用法?C# NameValueCollection.IsNull怎么用?C# NameValueCollection.IsNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.NameValueCollection
的用法示例。
在下文中一共展示了NameValueCollection.IsNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override void Initialize(string name, NameValueCollection config)
{
if (config.IsNull())
throw new ArgumentNullException("config");
if (name.IsNullOrWhiteSpace())
name = "AsliMotorMembershipProvider";
if (config["description"].IsNullOrWhiteSpace())
{
config.Remove("description");
config.Add("description", "AsliMotor Membership provider");
}
base.Initialize(name, config);
ApplicationName = getConfigValue(config["applicationName"], System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath);
pMaxInvalidPasswordAttempts = Convert.ToInt32(getConfigValue(config["maxInvalidPasswordAttempts"], "5"));
pPasswordAttemptWindow = Convert.ToInt32(getConfigValue(config["passwordAttemptWindow"], "10"));
pMinRequiredNonAlphanumericCharacters = Convert.ToInt32(getConfigValue(config["minRequiredNonAlphanumericCharacters"], "1"));
pMinRequiredPasswordLength = Convert.ToInt32(getConfigValue(config["minRequiredPasswordLength"], "7"));
pPasswordStrengthRegularExpression = Convert.ToString(getConfigValue(config["passwordStrengthRegularExpression"], ""));
pEnablePasswordReset = Convert.ToBoolean(getConfigValue(config["enablePasswordReset"], "true"));
pEnablePasswordRetrieval = Convert.ToBoolean(getConfigValue(config["enablePasswordRetrieval"], "true"));
pRequiresQuestionAndAnswer = Convert.ToBoolean(getConfigValue(config["requiresQuestionAndAnswer"], "false"));
pRequiresUniqueEmail = Convert.ToBoolean(getConfigValue(config["requiresUniqueEmail"], "true"));
encryptionKey = HexToByte(getConfigValue(config["encryptionKey"], "ABCDEEA2EFAA00B42A"));
string password_format = config["passwordFormat"];
if (password_format.IsNullOrWhiteSpace())
{
password_format = "Hashed";
}
switch (password_format)
{
case "Hashed":
pPasswordFormat = MembershipPasswordFormat.Hashed;
break;
case "Encrypted":
pPasswordFormat = MembershipPasswordFormat.Encrypted;
break;
case "Clear":
pPasswordFormat = MembershipPasswordFormat.Clear;
break;
default:
throw new Exception(String.Format("PasswordFormatNotSupportedMessage"));
}
_reportingRepository = (IReportingRepository) ContextRegistry.GetContext().GetObject("ReportingRepository");
_queryObjectMapper = (QueryObjectMapper) ContextRegistry.GetContext().GetObject("QueryObjectMapper");
}
示例2: Initialize
public override void Initialize(string name, NameValueCollection config)
{
if (config.IsNull())
throw new ArgumentNullException("config");
if (String.IsNullOrEmpty(name))
name = "NHRoleProvider";
if (String.IsNullOrEmpty(config["description"]))
{
config.Remove("description");
config.Add("description", "AsliMotor Role provider");
}
base.Initialize(name, config);
if (String.IsNullOrEmpty(config["applicationName"]) || config["applicationName"].Trim() == "")
{
ApplicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;
}
else
{
ApplicationName = config["applicationName"];
}
_reportingRepository = ContextRegistry.GetContext().GetObject("ReportingRepository") as IReportingRepository;
_queryObjectMapper = ContextRegistry.GetContext().GetObject("QueryObjectMapper") as QueryObjectMapper;
}