c# 匿名用户登录以后的事件处理
为了解决匿名用户登录成功以后,执行一些操作。在petshop有实现
1.在web.config中 加入 <anonymousIdentification enabled="true" />
表示激发Profile_MigrateAnonymous事件
2.在Global.asax中定义事件
void Profile_MigrateAnonymous(Object sender, ProfileMigrateEventArgs e) { // 获取匿名用户资料
}
其中: e.AnonymousID为匿名用户登录的id
var currentUser = HttpContext.Current.User;为登录的用户名
补充:软件开发 , C# ,