ProfileSection.DefaultProvider 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置默认配置文件提供程序的名称。
public:
property System::String ^ DefaultProvider { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlProfileProvider")]
[System.Configuration.StringValidator(MinLength=1)]
public string DefaultProvider { get; set; }
[<System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlProfileProvider")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.DefaultProvider : string with get, set
Public Property DefaultProvider As String
属性值
集合中 Providers 提供程序的名称或空字符串(“)。 默认值为“AspNetSqlProfileProvider”。
- 属性
示例
下面的代码示例演示如何使用该 DefaultProvider 属性。 该代码示例是 ProfileSection 类中的一个较大示例的一部分。
// Get the current DefaultProvider property value.
Console.WriteLine(
"Current DefaultProvider value: '{0}'", profileSection.DefaultProvider);
// Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider";
' Get the current DefaultProvider property value.
Console.WriteLine( _
"Current DefaultProvider value: '{0}'", profileSection.DefaultProvider)
' Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider"
注解
配置文件提供程序指向在其中存储用户配置文件值的数据源。 可以在配置文件的子节profile中providers指定配置文件提供程序。