![]() |
|
|
#1 |
|
Registered User
Join Date: Mar 2009
Posts: 121
|
Membership on Asp.net 2
سلام
یه سوال داشتم. فرض کنید ما برای صفحاتمون از سرویس عضویت Asp.net استفاده کردیم و یه کاربر اومد و با یوزر و پس خودش لاگین شد. از کجا می تونیم بفهمیم این کاربر که لاگین کرده UserID یا اسمش و ویژگی های دیگه اش چیه؟ این روش روش امنی هست اگه خودمون با استقاده از Session بنویسیم چطور |
|
|
|
|
|
#2 | |
|
Registered User
|
Quote:
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...0-528.html?s=1
__________________
برنامه نویس NET.|طراح سایت من از آن روز که در بند توام آزادم گفتار نیک-کردار نیک-پندار نیک |
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 2009
Posts: 121
|
ممنون. بابت توضیحتون
کتابو دانلود می کنم می خونم. اگه مشکلی داشتم می پرسم |
|
|
|
|
|
#4 |
|
ASP.net مدیر
|
سلام
نام کاربر رو میتونید اینطوری بگیرید : PHP Code:
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx و البته که خیلی خوبه اینطوری سیستم لاگینتون رو بسازید تا اینکه از اول چرخ سنگی رو اختراع کنید !
__________________
![]() ای مفتــــــــی شهـــــــــــر از تــــــو بیــدارتـــــریــــم ----------بــا ایـــــن همـــــه مستی ز تــــو هشیارتـــــریــــم تـــو خـــون کســــــان نوشـــــی و مــــا خـــون رزان ---------- انصـــــــــــاف بـــــــــــده کــــــــــــدام خونخــــوارتریم
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Mar 2009
Posts: 121
|
دست همه دوستان درد نکنه
یه سوال دیگه مشخصات دیگه کاربر رو چجوری میشه پیدا کرد؟ |
|
|
|
|
|
#6 |
|
ASP.net مدیر
|
PHP Code:
|
|
|
|
![]() |
| امکانات بيشتر | |
|
|