简体   繁体   中英

ASP.NET Membership Search

I did not find any Complete Search for ASP.NET Membership. for example i want to search a user with this detail : Username , Creation Date, last Activity Date , Last Login Date , Email , IsUserOnline,IsApproved , IsLockedOut , Has this Roles , Has Not This Roles . have i load all users in RAM and filter them Server Side ? this way has bad performance . is there any better exist ?

If the Membership framework doesn't provide the full search functionality you need you could implement a custom membership provider which delivers the specific functionality you need.

If that's too much work, then just roll some stored procedures to query the database yourself and call them when needed. It's not as tidy as keeping everything in the one place, but the schema is pretty simple.

Implementing a Membership Provider

the Membership did not provide search functions for the one you ask.

You can use the Membership.FindUsersByName , Membership.GetUserNameByEmail and some more that you can find on msdn , but not the other.

If you have few users that are stored on your web.config file, then just load them all and make your search as you say.

If from the other hand you use a database, then you can connect to the database and get your informations you ask by simple sql query.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM