ClientTargetSection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
섹션을 clientTarget 구성합니다. 이 클래스는 상속할 수 없습니다.
public ref class ClientTargetSection sealed : System::Configuration::ConfigurationSection
public sealed class ClientTargetSection : System.Configuration.ConfigurationSection
type ClientTargetSection = class
inherit ConfigurationSection
Public NotInheritable Class ClientTargetSection
Inherits ConfigurationSection
- 상속
예제
이 섹션에서는 두 가지 코드 예제를 제공합니다. 첫 번째는 클래스의 선언적 표현을 ClientTargetSection 표시하고 클래스의 여러 속성 ClientTarget 에 대한 값을 선언적으로 지정하는 방법도 보여 줍니다. 두 번째는 구성 파일에서 개체를 ClientTargetCollection 가져오는 방법을 보여줍니다. 이 개체를 사용하여 포함된 개체에 ClientTarget 액세스합니다.
다음 코드 예제에서는 선언적으로 클래스의 여러 속성에 대 한 값을 지정 하는 방법을 보여 있습니다 ClientTarget .
<clientTarget>
<add alias=
"uplevel" userAgent="Mozilla/5.0 (compatible;MSIE 6.0;Windows NT 5.1)"/>
<add alias="downlevel" userAgent="Generic Downlevel"/>
</clientTarget>
다음 코드 예제에서는 구성 파일에서 개체를 ClientTargetCollection 가져오는 방법을 보여줍니다.
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the <clientTarget> section.
ClientTargetSection clientTargetSection =
(ClientTargetSection)configuration.GetSection(
"system.web/clientTarget");
// Get the client target collection.
ClientTargetCollection clientTargets =
clientTargetSection.ClientTargets;
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the <clientTarget> section.
Dim clientTargetSection _
As ClientTargetSection = _
CType(configuration.GetSection( _
"system.web/clientTarget"), _
ClientTargetSection)
' Get the client target collection.
Dim clientTargets _
As ClientTargetCollection = _
clientTargetSection.ClientTargets
설명
클래스는 ClientTargetSection 프로그래밍 방식으로 액세스 하 고 구성 파일의 섹션을 수정 하는 clientTarget 방법을 제공 합니다. 클래스와 클래스를 포함하는 ClientTargetCollection 그룹에 속합니다 ClientTarget .
ClientTargetSection 클래스에는 ASP.NET 서버 컨트롤이 콘텐츠를 렌더링해야 하는 별칭 쌍 및 연결된 대상 사용자 에이전트 쌍을 정의하는 ClientTarget 개체가 포함되어 있습니다.
생성자
| Name | Description |
|---|---|
| ClientTargetSection() |
ClientTargetSection 클래스의 새 인스턴스를 초기화합니다. |