我是學生寫作項目,我想了解asp.net會員和用戶管理。從登錄控制獲取信息
我看了很多文章,有些很方便,但有些讓我困惑。 看完這個:Examining ASP.NET's Membership, Roles, and Profile
我定義了一個SqlMembershipProvider,它爲我在我的sql服務器中創建了用戶數據庫。 然後我從.net的管理工具中定義了一些用戶,並在我的aspx頁面添加了一個登錄控件。
我的問題是:
哪裏控制保存有關記錄在用戶的信息? 以及我如何訪問它?
我該如何定義自己的登錄功能來驗證用戶,並將其重定向到另一個頁面?
如何在新頁面中使用loginstatus控件顯示 關於不同用戶登錄或匿名的信息?
我想限制某些網頁給某些用戶,並建立基於不同用戶的動態網頁 。是否需要定義角色並檢查用戶角色 ?
還有哪些更多的會員功能可以幫助我管理用戶和角色?
這個決定性的提供者和連接字符串後的配置文件:
<configuration>
<connectionStrings>
<add name="igroup20_test2ConnectionString" connectionString="Data Source=Media.ruppin.ac.il;Initial Catalog=igroup20_test2;User ID=igroup20;Password=********" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<authentication mode="Forms"/>
<compilation debug="true" targetFramework="4.0"/>
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="igroup20_test2ConnectionString" applicationName="ScottsProject" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
</system.web>
</configuration>
這些都是供應商在MS SQL Server中創建表:
aspnet_Applications
aspnet_Membership
aspnet_Paths
aspnet_PersonalizationAllUsers
aspnet_PersonalizationPerUser
aspnet_Profile
aspnet_Roles
aspnet_SchemaVersions
aspnet_Users
aspnet_UsersInRoles
aspnet_WebEvent_Events
我會真正appriciate你的答案:)
你看過'System.Web.Security.Membership'嗎?它可以讓你對aspnet表進行身份驗證,並執行各種安全措施。 http://msdn.microsoft.com/en-us/library/system.web.security.membership.aspx – gwin003 2013-04-30 13:50:10