Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从代码 (C#) 中获取默认的 asp.net 会员提供程序名称?
使用Membership.Provider.Name这将返回web.config文件中使用的名称
Membership.Provider.Name
web.config
编辑:仅在我defaultProvider在该membership部分中设置的情况下才有效
defaultProvider
membership
您可以随时使用访问 web.config 文件 WebConfigurationManager.GetSection
WebConfigurationManager.GetSection