更新:2007 年 11 月
允许用户以编程方式访问配置文件的 system.web 组。无法继承此类。
命名空间:
System.Web.Configuration 程序集:
System.Web(在 System.Web.dll 中)
Public NotInheritable Class SystemWebSectionGroup _
Inherits ConfigurationSectionGroup
Dim instance As SystemWebSectionGroup
public sealed class SystemWebSectionGroup : ConfigurationSectionGroup
public ref class SystemWebSectionGroup sealed : public ConfigurationSectionGroup
public final class SystemWebSectionGroup extends ConfigurationSectionGroup
public final class SystemWebSectionGroup extends ConfigurationSectionGroup
SystemWebSectionGroup 类引用配置文件内的 system.web 组。可以使用此类型来访问此组中包含的任意节。
下面的代码示例演示如何从与现有 Web 应用程序关联的配置文件获取 SystemWebSectionGroup 对象。可以使用此对象访问 system.web 组中包含的节。
' 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)
// 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
参考
其他资源