2023-02-16 305
我正在利用这个会员提供者.我陷入了获取用户列表+配置文件(名字,姓氏,标题等)
我知道有成员身份的方法.GetAllUsers(),但我不知道如何将其与我存储在个人资料提供程序中的名字,我存储的姓氏.
感谢
emperenthip.getAllusers()返回emperenceUserCollection,您可以用于访问单个隶属度数.示例:
MembershipUserCollection users = Membership.GetAllUsers();
string email = users["some_username"].Email;
您还可以以类似的方式检索profileinfo:
ProfileInfoCollection profiles = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);
DateTime lastActivity = profiles["some_username"].LastActivityDate;
但是,默认情况下,除非您在个人资料提供程序中手动指定它们,否则没有第一个名称和LastName属性.
签出 empersialuser类和 profileinfo class 有关更多详细信息.您也可能想查看 sqlprofileprovider类个人资料提供商的示例,除非您已经实现了一个.
首先创建用户时,使用相同的用户名创建配置文件:
// Create an empty Profile for the new User
ProfileCommon p = (ProfileCommon) ProfileCommon.Create("username", true);
然后下次检索它..
// Retrieve a particular profile
ProfileCommon userProfile = Profile.GetProfile("username");
谢谢.
以上所述是小编给大家介绍的如何从会员制供应商那里获得用户/档案的列表?,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!
原文链接:https://77isp.com/post/33857.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态