當前位置: 首頁>>代碼示例>>C#>>正文


C# Security.MembershipProvider類代碼示例

本文整理匯總了C#中System.Web.Security.MembershipProvider的典型用法代碼示例。如果您正苦於以下問題:C# MembershipProvider類的具體用法?C# MembershipProvider怎麽用?C# MembershipProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MembershipProvider類屬於System.Web.Security命名空間,在下文中一共展示了MembershipProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DefaultProviderSwitcher

        public DefaultProviderSwitcher(
            MembershipProviderAccessor membershipProviderAccessor, 
            RoleProviderAccessor roleProviderAccessor, 
            MembershipProvider provider, 
            RoleProvider roleProvider)
        {
            Condition.Requires(membershipProviderAccessor, "membershipProviderAccessor").IsNotNull();
            Condition.Requires(roleProviderAccessor, "roleProviderAccessor").IsNotNull();
            Condition.Requires(provider, "provider").IsNotNull();
            Condition.Requires(roleProvider, "roleProvider").IsNotNull();

            this.membershipProviderAccessor = membershipProviderAccessor;
            this.roleProviderAccessor = roleProviderAccessor;

            this.originalMembershipInitializedDefault =
                membershipProviderAccessor.SetInitializedDefaultProviderAndReturnOriginalValue(true);
            this.originalMembershipInitialized = membershipProviderAccessor.SetInitializedAndReturnOriginalValue(true);
            this.originalMembershipProvider = membershipProviderAccessor.SetProviderAndReturnOriginalValue(provider);

            this.originalRoleEnabledInitialized = roleProviderAccessor.SetEnabledAndReturnOriginalValue(true);
            this.originalRoleProviders =
                roleProviderAccessor.SetProvidersAndReturnOriginalValue(new RoleProviderCollection());
            this.originalRoleInitializedDefault =
                roleProviderAccessor.SetInitializedDefaultProviderAndReturnOriginalValue(true);
            this.originalRoleInitialized = roleProviderAccessor.SetInitializedAndReturnOriginalValue(true);
            this.originalRoleProvider = roleProviderAccessor.SetProviderAndReturnOriginalValue(roleProvider);
        }
開發者ID:TheCodeKing,項目名稱:BetterMembership.Net,代碼行數:27,代碼來源:DefaultProviderSwitcher.cs

示例2: MembershipService

 public MembershipService()
 {
     if (Membership.Provider is MonsterMembershipProvider)
         Provider = Membership.Provider;
     else
         throw new InvalidOperationException("Membership provider not supported");
 }
開發者ID:calipsod,項目名稱:Storage-Monster,代碼行數:7,代碼來源:MembershipService.cs

示例3: InitializeMembershipProviderFromConfigEntry

        public void InitializeMembershipProviderFromConfigEntry(MembershipProvider result,
            IEnumerable<KeyValuePair<string, string>> simulatedAppConfigSettings)
        {
            NameValueCollection nameValueCollection = null;

            MembershipSection membership = ConfigurationManager.GetSection("system.web/membership") as MembershipSection;

            foreach (ProviderSettings settings in membership.Providers)
            {
                if (settings.Name == FixtureConstants.NameOfConfiguredMembershipProvider)
                {
                    nameValueCollection = new NameValueCollection(settings.Parameters);
                    break;
                }
            }

            if (nameValueCollection == null)
            {
                throw new Exception("Configuration not found for membership provider RavenDBMembership.");
            }

            nameValueCollection["connectionStringName"] = "StubConnectionString";

            foreach (var kvp in simulatedAppConfigSettings)
            {
                ValidateConfigurationValue(kvp.Key, kvp.Value);
                nameValueCollection.Set(kvp.Key, kvp.Value);
            }

            result.Initialize(FixtureConstants.NameOfConfiguredMembershipProvider, nameValueCollection);
        }
開發者ID:GrillerGeek,項目名稱:RavenDBMembership,代碼行數:31,代碼來源:MembershipProviderOverride.cs

示例4: AuthenticationService

        public AuthenticationService(MembershipProvider membershipProvider)
        {
            _membershipProvider = membershipProvider
                                  ?? Membership.Provider;

            MinPasswordLength = _membershipProvider.MinRequiredPasswordLength;
        }
開發者ID:Ordojan,項目名稱:Online-movie-store,代碼行數:7,代碼來源:AuthenticationService.cs

示例5: AccountMembershipService

        public AccountMembershipService(MembershipProvider provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            _provider = provider;
        }
開發者ID:jlaanstra,項目名稱:Munq,代碼行數:7,代碼來源:AccountMembershipService.cs

示例6: CreateDefaultSimpleMembershipProvider

 private static SimpleMembershipProvider CreateDefaultSimpleMembershipProvider(string name, MembershipProvider currentDefault)
 {
     MembershipProvider previousProvider = currentDefault;
     SimpleMembershipProvider provider = new SimpleMembershipProvider(previousProvider);
     NameValueCollection config = new NameValueCollection();
     provider.Initialize(name, config);
     return provider;
 }
開發者ID:kathird89,項目名稱:SampleProject,代碼行數:8,代碼來源:SimpleMembershipMvc3.cs

示例7: SQLiteFacebookMembershipProvider

 public SQLiteFacebookMembershipProvider(string connectionString, string tableName, MembershipProvider membershipProvider)
 {
     _connectionString = connectionString;
     _tableName = tableName ?? "facebook_users";
     _membershipProvider = membershipProvider;
     // we cound had done _membershipProvider = membershipProvider ?? Membership.Provider
     // but that wouldn't allow to work under client profile
 }
開發者ID:prabirshrestha,項目名稱:FacebookSharp,代碼行數:8,代碼來源:SQLiteFacebookMembershipProvider.cs

示例8: WebValidateUserPolicy

 public WebValidateUserPolicy(MembershipProvider provider)
     : base((IMemberShipProvider)provider)
 {
     this.MaxInvalidPasswordAttempts = provider.MaxInvalidPasswordAttempts;
     this.PasswordAttemptWindow = provider.PasswordAttemptWindow;
     this.PasswordStrengthRegularExpression = provider.PasswordStrengthRegularExpression;
     this.MinRequiredPasswordLength = provider.MinRequiredPasswordLength;
 }
開發者ID:luqizheng,項目名稱:OrnamentFramework,代碼行數:8,代碼來源:WebValidateUserPolicy.cs

示例9: CreateMembershipProviderValidator

 public static UserNamePasswordValidator CreateMembershipProviderValidator(MembershipProvider provider)
 {
     if (provider == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("provider");
     }
     return new MembershipProviderValidator(provider);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:UserNamePasswordValidator.cs

示例10: MySqlSimpleMembershipProvider

 public MySqlSimpleMembershipProvider(MembershipProvider previousProvider)
 {
   _prevProvider = previousProvider;
   if (_prevProvider != null)
   {
     _prevProvider.ValidatingPassword += delegate(object sender, ValidatePasswordEventArgs args) { this.OnValidatingPassword(args); };
   }
 }
開發者ID:betabot7,項目名稱:mysql-connector-net,代碼行數:8,代碼來源:SimpleMembershipProvider.cs

示例11: ClientFormsIdentity

		public ClientFormsIdentity (string name, string password, MembershipProvider provider, string authenticationType, bool isAuthenticated, CookieContainer authenticationCookies)
		{
			Password = password;
			Name = name;
			Provider = provider;
			AuthenticationType = authenticationType;
			IsAuthenticated = isAuthenticated;
			AuthenticationCookies = authenticationCookies;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:9,代碼來源:ClientFormsIdentity.cs

示例12: ClientFormsIdentity

 public ClientFormsIdentity(string name, string password, MembershipProvider provider, string authenticationType, bool isAuthenticated, CookieContainer authenticationCookies)
 {
     _Name = name;
     _AuthenticationType = authenticationType;
     _IsAuthenticated = isAuthenticated;
     _AuthenticationCookies = authenticationCookies;
     _Password = GetSecureStringFromString(password);
     _Provider = provider;
 }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:9,代碼來源:ClientFormsIdentity.cs

示例13: FakeMembershipProviderTest

    public FakeMembershipProviderTest()
    {
      this.localProvider = Substitute.For<MembershipProvider>();
      this.provider = new FakeMembershipProvider();
      this.provider.LocalProvider.Value = this.localProvider;

      this.user = new MembershipUser("fake", UserName, new Guid(), null, null, null, true, false, DateTime.MinValue,
        DateTime.Now, DateTime.Now, DateTime.MinValue, DateTime.MinValue);
    }
開發者ID:dharnitski,項目名稱:Sitecore.FakeDb,代碼行數:9,代碼來源:FakeMembershipProviderTest.cs

示例14: Create

 public static RequestInterceptor Create(string realm, MembershipProvider membershipProvider)
 {
     var basicAuthenticationCredentialsExtractor = new BasicAuthenticationCredentialsExtractor(new Base64Decoder(), new DecodedCredentialsExtractor());
      var httpRequestAuthorizationExtractor = new AuthorizationStringExtractor();
      var responseMessageFactory = new ResponseMessageFactory(realm);
      var serviceSecurityContextFactory = new ServiceSecurityContextFactory(new AuthorizationPolicyFactory());
      var basicAuthenticationManager = new BasicAuthenticationManager(basicAuthenticationCredentialsExtractor, httpRequestAuthorizationExtractor, membershipProvider, responseMessageFactory, serviceSecurityContextFactory);
      return new BasicAuthenticationInterceptor(basicAuthenticationManager);
 }
開發者ID:kalkie,項目名稱:BasicAuthenticationUsingWCFRest,代碼行數:9,代碼來源:RequestInterceptorFactory.cs

示例15: PostInitializeUpdate

        public override void PostInitializeUpdate(MembershipProvider provider)
        {
            var connectionStringProperty = typeof(SqlMembershipProvider).GetField("_sqlConnectionString",
                                                                                   BindingFlags.NonPublic |
                                                                                   BindingFlags.Instance);

            Assert.That(connectionStringProperty, Is.Not.Null);

            connectionStringProperty.SetValue(provider, DatabaseInitialization.GetConnectionStringFor(FixtureConstants.DatabaseName));
        }
開發者ID:GrillerGeek,項目名稱:RavenDBMembership,代碼行數:10,代碼來源:OverrideForSqlMembershipProvider.cs


注:本文中的System.Web.Security.MembershipProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。