语言

ProfileSettings.MinInstances 属性

定义

获取或设置在将事件引发到提供程序之前发生的最小事件次数。

public:
 property int MinInstances { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("minInstances", DefaultValue=1)]
[System.Configuration.IntegerValidator(MinValue=1)]
public int MinInstances { get; set; }
[<System.Configuration.ConfigurationProperty("minInstances", DefaultValue=1)>]
[<System.Configuration.IntegerValidator(MinValue=1)>]
member this.MinInstances : int with get, set
Public Property MinInstances As Integer

属性值

向提供程序触发事件之前发生的最小事件次数。 默认值为 1。

属性

示例

下面的代码示例演示如何使用该 MinInstances 属性。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

profileSetting.MinInstances = 1;
profileSetting.MinInstances = 1

注解

此属性的值必须大于零。 通过将该值设置为 可以无限。 无效值可能会导致保存配置节时引发异常。

此属性指定在向提供程序引发事件之前发生的事件的最小次数。 例如,表示 5 ASP.NET 在事件发生的第五个实例之前不会向提供程序引发事件。 如果该值是无限的(MaxValue),则不会向提供程序引发任何事件。

适用于

另请参阅