ProfilePropertySettings 构造函数
定义
初始化 ProfilePropertySettings 类的新实例。Initializes a new instance of the ProfilePropertySettings class.
重载
| ProfilePropertySettings(String) |
用指定的名称初始化 ProfilePropertySettings 类的新实例。Initializes a new instance of the ProfilePropertySettings class with the specified name. |
| ProfilePropertySettings(String, Boolean, SerializationMode, String, String, String, Boolean, String) |
使用指定的名称和设置初始化 ProfilePropertySettings 类的新实例。Initializes a new instance of the ProfilePropertySettings class with the specified name and settings. |
ProfilePropertySettings(String)
用指定的名称初始化 ProfilePropertySettings 类的新实例。Initializes a new instance of the ProfilePropertySettings class with the specified name.
public:
ProfilePropertySettings(System::String ^ name);
public ProfilePropertySettings (string name);
new System.Web.Configuration.ProfilePropertySettings : string -> System.Web.Configuration.ProfilePropertySettings
Public Sub New (name As String)
参数
- name
- String
ProfilePropertySettings 对象的唯一名称。A unique name for the ProfilePropertySettings object.
注解
下表显示了用于此构造函数的默认设置。The following table shows the default settings that are used for this constructor.
| 设置Setting | 默认值Default Value |
|---|---|
| AllowAnonymous | false.false. |
| DefaultValue | 空字符串 ("")。An empty string (""). |
| ReadOnly | false.false. |
| SerializeAs | ProviderSpecific.ProviderSpecific. |
| Type | 空字符串 ("")。An empty string (""). |
另请参阅
适用于
ProfilePropertySettings(String, Boolean, SerializationMode, String, String, String, Boolean, String)
使用指定的名称和设置初始化 ProfilePropertySettings 类的新实例。Initializes a new instance of the ProfilePropertySettings class with the specified name and settings.
public:
ProfilePropertySettings(System::String ^ name, bool readOnly, System::Web::Configuration::SerializationMode serializeAs, System::String ^ providerName, System::String ^ defaultValue, System::String ^ profileType, bool allowAnonymous, System::String ^ customProviderData);
public ProfilePropertySettings (string name, bool readOnly, System.Web.Configuration.SerializationMode serializeAs, string providerName, string defaultValue, string profileType, bool allowAnonymous, string customProviderData);
new System.Web.Configuration.ProfilePropertySettings : string * bool * System.Web.Configuration.SerializationMode * string * string * string * bool * string -> System.Web.Configuration.ProfilePropertySettings
Public Sub New (name As String, readOnly As Boolean, serializeAs As SerializationMode, providerName As String, defaultValue As String, profileType As String, allowAnonymous As Boolean, customProviderData As String)
参数
- name
- String
ProfilePropertySettings 对象的唯一名称。A unique name for the ProfilePropertySettings object.
- readOnly
- Boolean
true 指示动态生成的 ProfileCommon 类中关联的属性应是只读的;否则为 false。true to indicate that the associated property in the dynamically generated ProfileCommon class should be read-only; otherwise, false.
- serializeAs
- SerializationMode
SerializationMode 值之一。One of the SerializationMode values.
- providerName
- String
来自 Providers 属性的提供程序名,或一个空字符串 ("")。The name of a provider from the Providers property, or an empty string ("").
- defaultValue
- String
一个字符串,包含生成的页 Profile 类中的命名属性使用的默认值。A string containing the default value used for the named property in the generated page Profile class.
- profileType
- String
有效的类型引用或空字符串。A valid type reference or an empty string.
- allowAnonymous
- Boolean
true 指示动态生成的 ProfileCommon 类中关联的属性应支持匿名用户;否则为 false,指示匿名用户不能更改命名的属性。true to indicate associated property in the dynamically generated ProfileCommon class should support anonymous users; otherwise, false, to indicate that anonymous users cannot change the named property.
- customProviderData
- String
一个字符串,包含与属性相关联的提供程序使用的特定于提供程序的信息。A string containing provider-specific information used by the provider associated with the property.
注解
在运行时,ASP.NET 编译系统使用配置文件的部分中指定的信息 profile 来生成一个名为的类 ProfileCommon ,该类派生自 ProfileBase 。At run time, the ASP.NET compilation system uses the information specified in the profile section of the configuration file to generate a class called ProfileCommon, which is derived from ProfileBase. 类允许访问和修改各个用户配置文件的值。The class allows you to access and modify the values for individual user profiles.
ProfileCommon类定义基于配置文件的节的子节中定义的属性 properties profile 。The ProfileCommon class definition is based on the properties defined in the properties subsection of the profile section of the configuration file. 创建类的实例时指定的参数值 ProfilePropertySettings 将用于定义类中的关联属性 ProfileCommon 。The parameter values that you specify when you create an instance of the ProfilePropertySettings class will be used to define an associated property in the ProfileCommon class.
有关配置文件属性的详细信息,请参阅 ASP.NET Profile Properties 概述。For more information about profile properties, see ASP.NET Profile Properties Overview.