.NETのメンバーシップとロールに付属するプロファイルの使用方法を学習しています。ただし、値を設定するチェーンの最上位がどこにあるかはわかりません。
//Q1. Does it mean I set auth manually when loading user, or create it if not already exists?
//Or am I meant to get the isauth value from somewhere and pass it in?
var currentUserProfile = ProfileBase.Create(Membership.GetUser().UserName, isauth);
var anyUserProfile = ProfileBase.Create(strNewUser, isauth);
//isauth: true to indicate the user is authenticated;
// false to indicate the user is anonymous.
そして、値を取得するには:
//Q2. Are res1 and res2 below reflecting the same thing?
//Gets a value that indicates whether the user has been authenticated
bool res1 = HttpContext.Current.User.Identity.IsAuthenticated;
//Gets a value indicating whether the user profile is for an anonymous user
bool res2 = HttpContext.Current.Profile.IsAnonymous;
それぞれのauth/anonymousの関係について混乱しています。ユーザーを認証または匿名にするための正しい方法はどれですか?ここでの私の目標は、匿名ユーザーと認証済みユーザーの両方がプロファイルを持つことができるようにすることです。