获取特定的会员资格提供者 [英] Get specific membership provider

查看:54
本文介绍了获取特定的会员资格提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取特定的会员资格提供者?

调用静态 Membership 方法将查询您已配置为defaultProvider的任何提供程序.是否可以获取对您的web.config中配置的特定提供程序的引用,并仅针对该提供程序进行查询?

When you make calls to the 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?

推荐答案

是的,如果您在web.config中配置了多个提供程序,则可以按名称查找它们.

Yes, if you have multiple providers configured in your web.config, you can look them up by name.

MembershipProvider membershipProvider = Membership.Providers["foo"];

这篇关于获取特定的会员资格提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆