ProfilePropertySettings.ReadOnly 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值确定动态生成的 ProfileCommon 类中的关联属性是否为只读。
public:
property bool ReadOnly { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("readOnly", DefaultValue=false)]
public bool ReadOnly { get; set; }
[<System.Configuration.ConfigurationProperty("readOnly", DefaultValue=false)>]
member this.ReadOnly : bool with get, set
Public Property ReadOnly As Boolean
属性值
false。
- 属性
示例
下面的代码示例演示如何使用该 ReadOnly 属性。 该代码示例是 ProfileSection 类中的一个较大示例的一部分。
// Get the current ReadOnly property value.
Console.WriteLine(
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly);
// Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true;
' Get the current ReadOnly property value.
Console.WriteLine( _
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly)
' Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true
注解
在运行时,ASP.NET 编译系统使用配置文件节中指定的 profile 信息来生成一 ProfileCommon个名为(派生自 ProfileBase)的类。 该类允许你访问和修改各个用户配置文件的值。
类ProfileCommon定义基于配置文件节的子节properties中profile定义的属性。 为类实例 ProfilePropertySettings 指定的属性值将用于定义类中的 ProfileCommon 关联属性。