0

我正在尝试在应用程序中使用SqlProfileProvider,似乎无法按照我想要的方式使用它。我想能够简单地调用了这样的轮廓:SqlProfileProvider - 你可以在项目中使用Profile.GetProfile()吗?

Profile p = Profile.GetProfile("naspinski"); 
p.Organization = "new_org"; 

,但我似乎无法找到使用GetProfile(),我似乎看到散落在网络的正确方法。有没有办法抓取,阅读和修改配置文件?

我在MVC 3中使用它,并将而不是实际上是作为特定用户登录,这将从指定的db拉用户。谢谢。

回答

3

要检索的个人资料:

var profile = ProfileBase.Create(HttpContext.Profile.UserName, true); 

而这里的MSDN documentation。以及有关自定义配置文件的nice blog post

+0

这是太棒了,正是我所期待的! – naspinski 2011-02-16 17:16:27