设置活动成员资格提供编程

编程入门 行业动态 更新时间:2024-10-15 06:18:57
本文介绍了设置活动成员资格提供编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个自定义的成员提供一个Web应用程序。我想用提供商连接到Progress数据库。

I have a web application with custom membership providers. The provider I want to use connects to a Progress database.

我有一个使用competely不同成员提供一个页面。我有tried通过在web.config 设置这个,但不能得到它的工作。

I have one page that uses a competely different membership provider. I've tried setting this via the web.config but cannot get it working.

所以我在想,如果我能为这个网页编程设定的成员资格提供程序。我看到 的,它有可能在一定程度上,虽然这看起来pretty哈克。我希望有会做这种或那种方式的清洁方式。一切对SO或更广泛的网络似乎在dead结束。这表明,我认为什么我尝试是不可能的,但它会很高兴知道无论哪种方式。

So I was wondering if I could set the membership provider programmatically for this page. I see here that it is possible on some level though this looks pretty hacky. I was hoping there'd be a clean way of doing this one way or another. Everything else on SO or the wider web seems to end in a dead end. This suggests to me that what I'm attempting is not possible but it would be nice to know either way.

是否可以简单地切换的MembershipProvider在运行时?

Is it possible to simply switch the MembershipProvider at runtime?

推荐答案

这是不是一个理想的解决方案,但你可以select不同的提供商在运行时。

This is not an ideal solution but you can select a different provider at runtime.

var p = (ProgressMembershipProvider)Membership.Providers["ProgressProvider"]; var user = p.GetUser("Foo", true);

更多推荐

设置活动成员资格提供编程

本文发布于:2023-10-18 14:54:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504560.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:成员   资格

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!