Asp.net Profile - SetPropertyValues
2009-12-18 14:43 蜡笔小旧 阅读(210) 评论(0) 编辑 收藏 举报SqlProfileProvider p = (SqlProfileProvider)this.Context.Profile.Providers["SqlProvider"]; SettingsContext settingsContext = new SettingsContext(); settingsContext.Add("UserName", userName); settingsContext.Add("IsAuthenticated", true); SettingsPropertyValueCollection pvalues = p.GetPropertyValues(settingsContext, ProfileBase.Properties); pvalues["RealName"].PropertyValue = realName; p.SetPropertyValues(settingsContext, pvalues);