Profile小技巧

来源:互联网 发布:网络诈骗案 编辑:程序博客网 时间:2024/04/30 06:59

Profile小技巧

1、WebSite和WebApplication

WebSite中的Page里有属性Profile访问动态类ProfileCommon的实例,Profile有framework自动生成,继承自ProfileBase,主要提供了强类型访问Profile Property的能力。

2、读取Profile的用户标识(也就是UserName)

WebSite:  Profile.UserName

WebApplication: Context.Profile.UserName

3、根据给定的userName读取Profile

WebSite: ProfileCommon pro = Profile.GetProfile(userName)

WebApplication:ProfileBase pro = ProfileBase.Create(userName)

 

 

 

http://teacherteng.blog.163.com/blog/static/257923142008769487506/

原创粉丝点击