0
A
回答
2
這是(簡而言之)你將如何實現默認配置文件提供程序。
在你的web.config中,添加
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ApplicationServices"
<!--same connection string as the membership provider-->
applicationName="/"/>
</providers>
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<!--...or whatever profile properties you want/need-->
</properties>
</profile>
然後你就可以將值分配給該配置文件屬性
ProfileBase profile = ProfileBase.Create(userName);
profile["FirstName"] = "John";
profile["LastName"] = "Smith";
還要讀值
string firstName;
string lastName;
ProfileBase profile = ProfileBase.Create(userName);
firstName = profile["FirstName"] as string,
lastName = profile["LastName"] as string,
+0
謝謝!實際上,我一直在尋找的是ProfileBase.Create(name):)無論如何,這個問題完全描述了這個話題,所以它對其他用戶 – 2013-02-15 09:35:14
相關問題
- 1. 通過ASP.NET Membership.OpenAuth獲取用戶個人資料信息
- 2. 如何在rails中獲取linkedin個人資料信息?
- 3. 如何從ASP.NET MVC獲取完整的Facebook個人資料
- 4. 如何從google + login android獲取個人資料信息?
- 5. 如何從Facebook API獲取用戶個人資料信息Android
- 6. 如何獲取Instagram個人資料信息?
- 7. 從「我的個人資料」中獲取信息
- 8. 如何獲取LinkedIn個人資料信息,然後默認信息Android
- 9. Chrome身份識別API以獲取個人資料信息
- 10. 通過Android應用程序在Google +上獲取個人資料信息
- 11. 如何在azure廣告中獲取用戶個人資料詳細信息b2c
- 12. 如何使用LinkedIn API獲取某人的個人資料信息
- 13. Facebook API:獲取用戶個人資料的詳細信息
- 14. Facebook獲取用戶的個人資料信息
- 15. 使用Angular2獲取用戶Auth個人資料信息Firebase
- 16. 從Android LinkedIn SDK獲取個人資料信息
- 17. 通過3個表獲取信息
- 18. 使用JavaScript API從LinkedIn獲取個人資料詳細信息
- 19. 如何從android應用程序中的twitter獲取個人資料信息?
- 20. 如何在Django中獲取用戶的Google個人資料信息?
- 21. 成功登錄Facebook後需要獲取個人資料信息
- 22. Google SingIn in Swift獲取個人資料信息
- 23. Facebook API,無法獲取名字和個人資料信息
- 24. PHP註冊個人資料信息
- 25. 如何使用身份提供商和asp.net MVC獲取linkedin個人資料信息5
- 26. Outlook Office 365 - 獲取完整個人資料詳細信息
- 27. 如何在android中集成google plus並獲取個人資料信息?
- 28. ASP.NET MVC查看個人資料
- 29. Google+ API檢索個人資料信息
- 30. 如何在iPhone SDK中訪問我的個人資料信息?
這個Q是太模糊了。什麼樣的會員供應商?什麼樣的數據庫訪問策略? – 2013-02-14 19:57:42
@Dave一個asp.net mvc buit-in成員資格提供者,並且我想訪問Users表,如果有可能的話 – 2013-02-14 20:00:23
,它的關係型數據庫。我最喜歡的方式是創建我想要的數據視圖並將其導入到我的edmx文件。使用電子郵件作爲關鍵。 – 2013-02-14 20:01:41