Share via


KeyValueConfigurationElement(String, String) 建構函式

定義

根據提供的參數,初始化 KeyValueConfigurationElement 類別的新執行個體。

public:
 KeyValueConfigurationElement(System::String ^ key, System::String ^ value);
public KeyValueConfigurationElement (string key, string value);
new System.Configuration.KeyValueConfigurationElement : string * string -> System.Configuration.KeyValueConfigurationElement
Public Sub New (key As String, value As String)

參數

key
String

KeyValueConfigurationElement 的索引鍵。

範例

下列程式代碼範例示範如何使用 建 KeyValueConfigurationElement 構函式。 此程式代碼範例是類別概觀所提供較大範例的 KeyValueConfigurationCollection 一部分。

// Create the KeyValueConfigurationElement.
KeyValueConfigurationElement myAdminKeyVal = 
  new KeyValueConfigurationElement(
  "myAdminTool", "admin.aspx");
' Create the KeyValueConfigurationElement.
Dim myAdminKeyVal As KeyValueConfigurationElement = _
  New KeyValueConfigurationElement _
  ("myAdminTool", "admin.aspx")

適用於

另請參閱