ConfigurationElement.ElementInformation 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 ElementInformation 物件,其中包含 ConfigurationElement 物件之不可自訂的資訊和功能。
public:
property System::Configuration::ElementInformation ^ ElementInformation { System::Configuration::ElementInformation ^ get(); };
public System.Configuration.ElementInformation ElementInformation { get; }
member this.ElementInformation : System.Configuration.ElementInformation
Public ReadOnly Property ElementInformation As ElementInformation
屬性值
ElementInformation,其中包含 ConfigurationElement 物件之不可自訂的資訊和功能。
範例
下列範例將示範如何使用 ElementInformation 屬性。
static public ElementInformation
GetElementInformation()
{
// Get the current configuration file.
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(
ConfigurationUserLevel.None);
// Get the section.
UrlsSection section =
(UrlsSection)config.GetSection("MyUrls");
// Get the element.
UrlConfigElement url = section.Simple;
ElementInformation eInfo =
url.ElementInformation;
return eInfo;
}
Public Shared Function GetElementInformation() _
As ElementInformation
' Get the current configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
' Get the section.
Dim section As UrlsSection = CType( _
config.GetSection("MyUrls"), UrlsSection)
' Get the element.
Dim url As UrlConfigElement = _
section.Simple
Dim eInfo As ElementInformation = _
url.ElementInformation
Return eInfo
End Function 'GetElementInformation