سلام
یه سوال داشتم. فرض کنید ما برای صفحاتمون از سرویس عضویت Asp.net استفاده کردیم و یه کاربر اومد و با یوزر و پس خودش لاگین شد. از کجا می تونیم بفهمیم این کاربر که لاگین کرده UserID یا اسمش و ویژگی های دیگه اش چیه؟
این روش روش امنی هست
اگه خودمون با استقاده از Session بنویسیم چطور
این قسمت از فصل11 کتاب مایکروسافت 70528 رو بخون.(اون قسمت قرمز کمکت میکنه)
The Membership Class
There are several classes and interfaces for user management; however, the most important class is the System.Web.Security.Membership class.
NOTE .NET 2.0
The Membership class is new in the .NET Framework version 2.0.
Membership provides capabilities to add, remove, and find users. These capabilities are provided by the following static methods:
■
CreateUser Adds a user to the database. Use this method if you create a custom page to enable users or administrators to add new accounts.
■
DeleteUser Removes a user from the data store. Use this method if you create custom user management tools.
■
FindUsersByEmail Gets a collection of membership users for whom the e-mail addresses contain the specified e-mail addresses to match.
■
FindUsersByName Gets a collection of membership users for whom the user names contain the specified user names to match.
■
GeneratePassword Creates a random password of the specified length. Use this if you are implementing custom controls to generate or reset passwords.
■
GetAllUsers Returns a collection of all users in the database.
■
GetNumberOfUsersOnline Returns the number of users currently logged on.
■
GetUser Returns a MembershipUser object representing the current logged-on user. Call this method any time you need to access the current user’s account.
■
GetUserNameByEmail Gets a user name for which the e-mail address for the user matches the specified e-mail address.
■
UpdateUser Updates the database with the information for the specified user. Use this method if you create a page to enable users or administrators to modify existing accounts.
■
ValidateUser Verifies that the supplied user name and password are valid. Use this method to check a user’s credentials if you create your own custom login controls.
اگه کتابو نداری میتونی از لینک زیر بگیری:
http://www.4shared.com/file/51078701/bab15549/Web-Based_Client_Development_Self_Packed_Training_Kit-MCTS_Dump_70-528.html?s=1