ConfigurationElement 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 ConfigurationElement 類別的新執行個體。
protected:
ConfigurationElement();
protected ConfigurationElement();
Protected Sub New ()
範例
以下範例展示了如何使用自訂建構子。
// Constructor allowing name, url, and port to be specified.
public UrlConfigElement(String newName,
String newUrl, int newPort)
{
Name = newName;
Url = newUrl;
Port = newPort;
}
' Constructor allowing name, url, and port to be specified.
Public Sub New(ByVal newName As String, _
ByVal newUrl As String, _
ByVal newPort As Integer)
Name = newName
Url = newUrl
Port = newPort
End Sub
備註
例如,每次應用程式需要新增元素到相關ConfigurationElement集合時,你都會建立一個新的類別實例ConfigurationElementCollection。