Share via


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

注解

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

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

适用于

另请参阅