PersianTools Forums

Go Back   PersianTools Forums > برنامه نویسی و طراحی وب، سیستمهای مدیریت سایت > توسعه وب > asp , ASP.NET

Reply
 
امکانات بيشتر
Old 10-21-2009, 01:14 AM   #1
Alghoochi
Registered User
 
Alghoochi's Avatar
 

Join Date: Mar 2009
Posts: 121
Membership on Asp.net 2

سلام

یه سوال داشتم. فرض کنید ما برای صفحاتمون از سرویس عضویت Asp.net استفاده کردیم و یه کاربر اومد و با یوزر و پس خودش لاگین شد. از کجا می تونیم بفهمیم این کاربر که لاگین کرده UserID یا اسمش و ویژگی های دیگه اش چیه؟

این روش روش امنی هست
اگه خودمون با استقاده از Session بنویسیم چطور
Alghoochi is offline   Reply With Quote
Old 10-29-2009, 12:10 AM   #2
actros
Registered User
 
actros's Avatar
 

Join Date: Oct 2006
Location: Tehran
Posts: 1,300
Send a message via Yahoo to actros
Icon1

Quote:
نوشته ای از Alghoochi View Post
سلام

یه سوال داشتم. فرض کنید ما برای صفحاتمون از سرویس عضویت 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...0-528.html?s=1
__________________
برنامه نویس NET.|طراح سایت

من از آن روز که در بند توام آزادم



گفتار نیک-کردار نیک-پندار نیک
actros is offline   Reply With Quote
Old 10-29-2009, 12:20 AM   #3
Alghoochi
Registered User
 
Alghoochi's Avatar
 

Join Date: Mar 2009
Posts: 121
ممنون. بابت توضیحتون

کتابو دانلود می کنم می خونم. اگه مشکلی داشتم می پرسم
Alghoochi is offline   Reply With Quote
Old 11-02-2009, 06:23 PM   #4
Moderator
H_R
ASP.net مدیر
 
H_R's Avatar
 

Join Date: Mar 2005
Location: Tehran
Posts: 3,393
Send a message via Yahoo to H_R
سلام
نام کاربر رو میتونید اینطوری بگیرید :

PHP Code:
httpcontext.current.user.identity.name 
این سری مقالات هم خیلی عالی همه چیز رو در این موارد توضیخ داده :
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

و البته که خیلی خوبه اینطوری سیستم لاگینتون رو بسازید تا اینکه از اول چرخ سنگی رو اختراع کنید !
__________________
ای مفتــــــــی شهـــــــــــر از تــــــو بیــدارتـــــریــــم ----------بــا ایـــــن همـــــه مستی ز تــــو هشیارتـــــریــــم
تـــو خـــون کســــــان نوشـــــی و مــــا خـــون رزان ---------- انصـــــــــــاف بـــــــــــده کــــــــــــدام خونخــــوارتریم
H_R is offline   Reply With Quote
Old 11-02-2009, 11:04 PM   #5
Alghoochi
Registered User
 
Alghoochi's Avatar
 

Join Date: Mar 2009
Posts: 121
دست همه دوستان درد نکنه

یه سوال دیگه مشخصات دیگه کاربر رو چجوری میشه پیدا کرد؟
Alghoochi is offline   Reply With Quote
Old 11-03-2009, 05:51 AM   #6
Moderator
H_R
ASP.net مدیر
 
H_R's Avatar
 

Join Date: Mar 2005
Location: Tehran
Posts: 3,393
Send a message via Yahoo to H_R
PHP Code:
 
MembershipUser currentUser 
Membership.GetUser(string Username ); 
بعد این وحله ی currentUser رو استفاده بفرمایید !
H_R is offline   Reply With Quote
Reply

امکانات بيشتر

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +4.5. The time now is 04:15 PM.

PersianTools RSS Feeds


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.