System.Configuration.ConfigurationElement.SetPropertyValue 方法
上一篇:System.Configuration.AppSettingsSection.SerializeToXmlElement 方法
下一篇:System.Configuration.AppSettingsSection.SetReadOnly 方法
方法描述
将属性设置为指定值。
语法定义(C# System.Configuration.ConfigurationElement.SetPropertyValue 方法 的用法)
protected void SetPropertyValue( ConfigurationProperty prop, Object value, bool ignoreLocks )
参数/返回值
参数值/返回值 | 参数类型/返回类型 | 参数描述/返回描述 |
---|---|---|
prop | System-Configuration-ConfigurationProperty | 要设置的元素属性。 |
value | System-Object | 要分配给属性的值。 |
ignoreLocks | System-Boolean | 如果对属性的锁定应该被忽略,则为 true;否则为 false。 |
返回值 | void |
提示和注释
System.Configuration.ConfigurationElement.SetPropertyValue 方法例子
异常
异常 | 异常描述 |
---|---|
ConfigurationErrorsException | 如果元素是只读的,或者 ignoreLocks 为 true 但不能忽略锁定,将引发此异常。 |
版本信息
.NET Framework 受以下版本支持:4、3.5、3.0、2.0 .NET Framework Client Profile 受以下版本支持:4、3.5 SP1
适用平台
Windows 7, Windows Vista SP1 或更高版本, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008(不支持服务器核心), Windows Server 2008 R2(支持 SP1 或更高版本的服务器核心), Windows Server 2003 SP2 .NET Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
上一篇:System.Configuration.AppSettingsSection.SerializeToXmlElement 方法
下一篇:System.Configuration.AppSettingsSection.SetReadOnly 方法