System.Web.Configuration 命名 ...


.NET Framework 类库
SystemWebSectionGroup 类

更新:2007 年 11 月

允许用户以编程方式访问配置文件的 system.web 组。无法继承此类。

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

语法

Visual Basic(声明)
Public NotInheritable Class SystemWebSectionGroup _
    Inherits ConfigurationSectionGroup
Visual Basic (用法)
Dim instance As SystemWebSectionGroup
C#
public sealed class SystemWebSectionGroup : ConfigurationSectionGroup
Visual C++
public ref class SystemWebSectionGroup sealed : public ConfigurationSectionGroup
J#
public final class SystemWebSectionGroup extends ConfigurationSectionGroup
JScript
public final class SystemWebSectionGroup extends ConfigurationSectionGroup
备注

SystemWebSectionGroup 类引用配置文件内的 system.web 组。可以使用此类型来访问此组中包含的任意节。

示例

下面的代码示例演示如何从与现有 Web 应用程序关联的配置文件获取 SystemWebSectionGroup 对象。可以使用此对象访问 system.web 组中包含的节。

Visual Basic
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")

' Get the <system.web> group.
Dim systemWeb As SystemWebSectionGroup = _
CType(configuration.GetSectionGroup( _
"system.web"), SystemWebSectionGroup)

C#
// Get the Web application configuration.
System.Configuration.Configuration configuration =
    WebConfigurationManager.OpenWebConfiguration(
    "/aspnetTest");

// Get the <system.web> group.
SystemWebSectionGroup systemWeb =
  (SystemWebSectionGroup)configuration.GetSectionGroup("system.web");

继承层次结构

System..::.Object
  System.Configuration..::.ConfigurationSectionGroup
    System.Web.Configuration..::.SystemWebSectionGroup
线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。
平台

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