UrlMappingsSection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
urlMappings 구성 섹션에 프로그래밍 방식으로 액세스합니다. 이 클래스는 상속될 수 없습니다.
public ref class UrlMappingsSection sealed : System::Configuration::ConfigurationSection
public sealed class UrlMappingsSection : System.Configuration.ConfigurationSection
type UrlMappingsSection = class
inherit ConfigurationSection
Public NotInheritable Class UrlMappingsSection
Inherits ConfigurationSection
- 상속
예제
다음 코드 예제에서는 가져오는 방법을 보여 줍니다는 UrlMappingsSection 기존 웹 애플리케이션의 구성 파일에서 개체입니다. 구성 파일의 일부는도 표시 됩니다.
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the <urlMapping> section.
UrlMappingsSection urlMappingSection =
(UrlMappingsSection)configuration.GetSection(
"system.web/urlMappings");
// Get the url mapping collection.
UrlMappingCollection urlMappings =
urlMappingSection.UrlMappings;
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the <urlMapping> section.
Dim urlMappingSection _
As UrlMappingsSection = _
CType(configuration.GetSection( _
"system.web/urlMappings"), UrlMappingsSection)
' Get the url mapping collection.
Dim urlMappings _
As UrlMappingCollection = _
urlMappingSection.UrlMappings
<urlMappings enabled="true">
<add url= "~/home.aspx"
mappedUrl="~/default.aspx?parm1=1"/>
<add url= "~/products.aspx"
mappedUrl="~/default.aspx?parm1=2"/>
</urlMappings>
설명
UrlMappingsSection 클래스를 사용하면 구성 파일의 urlMappings 섹션을 프로그래밍 방식으로 액세스하고 수정할 수 있습니다.
참고
합니다 urlMappings 단원의 UrlMapping 웹 애플리케이션에 존재 하는 Url로 사용자에 게 표시 되는 Url에 매핑되는 개체입니다. 합니다 UrlMappingsSection section 속성으로 정의 된 제한에 따라 구성 파일의 관련된 섹션에 정보를 작성할 수 있습니다 AllowDefinition 값인 MachineToApplication합니다. 계층에서 허용 되지 않습니다 수준에서 구성 파일에 쓰려고 시도 파서에 의해 생성 된 오류 메시지가 발생 합니다. 그러나 계층의 모든 수준에서 구성 정보를 읽을이 클래스를 사용할 수 있습니다.
생성자
| UrlMappingsSection() |
UrlMappingsSection 클래스의 새 인스턴스를 초기화합니다. |