.NET Framework 类库
SystemWebSectionGroup..::.UrlMappings 属性

更新:2007 年 11 月

获取 urlMappings 节。

命名空间:  System.Web.Configuration
程序集:  System.Web(在 System.Web.dll 中)

语法

Visual Basic(声明)
<ConfigurationPropertyAttribute("urlMappings")> _
Public ReadOnly Property UrlMappings As UrlMappingsSection
Visual Basic (用法)
Dim instance As SystemWebSectionGroup
Dim value As UrlMappingsSection

value = instance.UrlMappings
C#
[ConfigurationPropertyAttribute("urlMappings")]
public UrlMappingsSection UrlMappings { get; }
Visual C++
[ConfigurationPropertyAttribute(L"urlMappings")]
public:
property UrlMappingsSection^ UrlMappings {
    UrlMappingsSection^ get ();
}
J#
/** @property */
/** @attribute ConfigurationPropertyAttribute("urlMappings") */
public UrlMappingsSection get_UrlMappings()
JScript
public function get UrlMappings () : UrlMappingsSection

属性值

类型:System.Web.Configuration..::.UrlMappingsSection

UrlMappingsSection 对象引用配置文件的 urlMappings 节。

示例

下面的代码示例演示如何从现有 Web 应用程序的配置文件获取 UrlMappingsSection 对象。

Visual Basic
' Get the urlMappings section.
Dim urlMappings _
As UrlMappingsSection = _
systemWeb.UrlMappings
' Read section information.
info = urlMappings.SectionInformation

name = info.SectionName
type = info.Type
declared = info.IsDeclared.ToString()
msg = String.Format("Name:     {0}" + _
ControlChars.Lf + "Declared: {1}" + _
ControlChars.Lf + "Type:     {2}" + _
ControlChars.Lf, name, declared, type)
C#
// Get the urlMappings section.
UrlMappingsSection urlMappings =
    systemWeb.UrlMappings;
// Read section information.
info =
    urlMappings.SectionInformation;

name = info.SectionName;
type = info.Type;
declared = info.IsDeclared.ToString();
msg = String.Format(
    "Name:     {0}\nDeclared: {1}\nType:     {2}\n",
    name, declared, type);
平台

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.5、3.0、2.0
另请参见

参考

其他资源

标记 :


Page view tracker