Share via


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"))

注解

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

properties 默认值
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)))

注解

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

properties 默认值
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"))

另请参阅

适用于