ProfilePropertySettings.AllowAnonymous プロパティ

定義

動的に生成された ProfileCommon クラスの関連付けられたプロパティを匿名ユーザーが設定できるかどうかを示す値を取得または設定します。

public:
 property bool AllowAnonymous { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("allowAnonymous", DefaultValue=false)]
public bool AllowAnonymous { get; set; }
[<System.Configuration.ConfigurationProperty("allowAnonymous", DefaultValue=false)>]
member this.AllowAnonymous : bool with get, set
Public Property AllowAnonymous As Boolean

プロパティ値

true ProfileCommon クラス内の関連付けられたプロパティを匿名ユーザーが設定できる場合は false。それ以外の場合は、匿名ユーザーがプロパティ値を変更できないことを示します。 既定値は、false です。

属性

次のコード例は、 AllowAnonymous プロパティの使用方法を示しています。 このコード例は、 ProfileSection クラスに提供されるより大きな例の一部です。

// Get the current AllowAnonymous property value.
Console.WriteLine(
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous);

// Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true;
' Get the current AllowAnonymous property value.
Console.WriteLine( _
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous)

' Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true

注釈

実行時に、ASP.NET コンパイル システムは、構成ファイルの profile セクションで指定された情報を使用して、ProfileBaseから派生した ProfileCommon というクラスを生成します。 このクラスを使用すると、個々のユーザー プロファイルの値にアクセスして変更できます。

ProfileCommon クラス定義は、構成ファイルの profile セクションの properties サブセクションで定義されているプロパティに基づいています。 ProfilePropertySettings クラスのインスタンスに指定するプロパティ値は、ProfileCommon クラスの関連付けられたプロパティを定義するために使用されます。

AllowAnonymous プロパティ値がfalseされたときに、ProfileCommon クラスのプロパティが匿名ユーザーによって変更されると、例外がスローされます。

適用対象

こちらもご覧ください