ProfileSettings 构造函数

定义

初始化 ProfileSettings 类的新实例。

重载

名称 说明
ProfileSettings(String)

初始化 ProfileSettings 类的新实例。 使用类的新实例的指定名称。

ProfileSettings(String, Int32, Int32, TimeSpan)

使用类的新实例 ProfileSettings 的指定设置初始化类的新实例。

ProfileSettings(String, Int32, Int32, TimeSpan, String)

使用类的新实例 BufferModeSettings 的指定设置初始化类的新实例。

ProfileSettings(String)

初始化 ProfileSettings 类的新实例。 使用类的新实例的指定名称。

public:
 ProfileSettings(System::String ^ name);
public ProfileSettings(string name);
new System.Web.Configuration.ProfileSettings : string -> System.Web.Configuration.ProfileSettings
Public Sub New (name As String)

参数

name
String

要创建的对象的名称 ProfileSettings

示例

下面的代码示例演示如何使用 ProfileSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Default"));
' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Default"))

注解

下表显示了用于此构造函数的默认设置。

财产 默认值
Custom 空字符串(“)。
MaxLimit MaxValue
MinInstances 1.
MinInterval Zero

另请参阅

适用于

ProfileSettings(String, Int32, Int32, TimeSpan)

使用类的新实例 ProfileSettings 的指定设置初始化类的新实例。

public:
 ProfileSettings(System::String ^ name, int minInstances, int maxLimit, TimeSpan minInterval);
public ProfileSettings(string name, int minInstances, int maxLimit, TimeSpan minInterval);
new System.Web.Configuration.ProfileSettings : string * int * int * TimeSpan -> System.Web.Configuration.ProfileSettings
Public Sub New (name As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan)

参数

name
String

要创建的对象的名称 ProfileSettings

minInstances
Int32

将事件引发到提供程序之前发生的最小事件数。

maxLimit
Int32

引发同一类型的事件的最大次数。

minInterval
TimeSpan

一个 TimeSpan ,指定引发同一类型的两个事件之间的间隔的最小长度。

示例

下面的代码示例演示如何使用 ProfileSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Critical", 
    1, 1024, new TimeSpan(0, 0, 00)));
' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Critical",  _
    1, 1024, new TimeSpan(0, 0, 00)))

注解

下表显示了用于此构造函数的默认设置。

财产 默认值
Custom 空字符串(“)。

另请参阅

适用于

ProfileSettings(String, Int32, Int32, TimeSpan, String)

使用类的新实例 BufferModeSettings 的指定设置初始化类的新实例。

public:
 ProfileSettings(System::String ^ name, int minInstances, int maxLimit, TimeSpan minInterval, System::String ^ custom);
public ProfileSettings(string name, int minInstances, int maxLimit, TimeSpan minInterval, string custom);
new System.Web.Configuration.ProfileSettings : string * int * int * TimeSpan * string -> System.Web.Configuration.ProfileSettings
Public Sub New (name As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan, custom As String)

参数

name
String

要创建的对象的名称 ProfileSettings

minInstances
Int32

将事件引发到提供程序之前发生的最小事件数。

maxLimit
Int32

引发同一类型的事件的最大次数。

minInterval
TimeSpan

一个 TimeSpan ,指定同一类型的两个事件之间的最小间隔。

custom
String

实现 IWebEventCustomEvaluator的自定义类的完全限定类型。

示例

下面的代码示例演示如何使用 ProfileSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Targeted", 
    1, Int32.MaxValue, new TimeSpan(0, 0, 10), 
    "MyEvaluators.MyTargetedEvaluator, MyCustom.dll"));
' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Targeted", _
    1, Int32.MaxValue, new TimeSpan(0, 0, 10), _
    "MyEvaluators.MyTargetedEvaluator, MyCustom.dll"))

另请参阅

适用于