ProfileSettings 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 ProfileSettings 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| 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
同類型事件被提出的最大次數。
範例
以下程式碼範例展示了如何使用 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
同類型事件被提出的最大次數。
- 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"))