UrlMappingCollection クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
UrlMapping オブジェクトのコレクションを表します。 このクラスは継承できません。
public ref class UrlMappingCollection sealed : System::Configuration::ConfigurationElementCollection
C#
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.UrlMapping))]
public sealed class UrlMappingCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.UrlMapping))>]
type UrlMappingCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class UrlMappingCollection
Inherits ConfigurationElementCollection
- 継承
- 属性
次のコード例は、既存の Web アプリケーションの UrlMappingCollection 構成ファイルからオブジェクトを取得する方法を示しています。 また、構成ファイルの抜粋も示されています。
<urlMappings enabled="true">
<add url= "~/home.aspx"
mappedUrl="~/default.aspx?parm1=1"/>
<add url= "~/products.aspx"
mappedUrl="~/default.aspx?parm1=2"/>
</urlMappings>
C#
// 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
この型を UrlMappingCollection 使用すると、 UrlMappings セクション要素コレクションの要素に UrlMappingsSection アクセスできます。
Url |
UrlMappingCollection クラスの新しいインスタンスを初期化します。 |
ICollection. |
ConfigurationElementCollection を配列にコピーします。 (継承元 ConfigurationElementCollection) |
Cast<TResult>(IEnumerable) |
IEnumerable の要素を、指定した型にキャストします。 |
Of |
指定された型に基づいて IEnumerable の要素をフィルター処理します。 |
As |
クエリの並列化を有効にします。 |
As |
IEnumerable を IQueryable に変換します。 |
製品 | バージョン |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |