Is there a way to obtain a specific membership provider?
When you make calls to th开发者_如何学编程e static Membership
methods they query whatever provider you have configured as the defaultProvider
. Is it possible to get a reference to a specific provider that is configured in your web.config and query against only that provider?
Yes, if you have multiple providers configured in your web.config, you can look them up by name.
MembershipProvider membershipProvider = Membership.Providers["foo"];
精彩评论