ConfigurationLockCollection.IsReadOnly(String) Method

Definition

验证某个特定的配置对象是否为只读。Verifies whether a specific configuration object is read-only.

public:
 bool IsReadOnly(System::String ^ name);
public bool IsReadOnly (string name);
member this.IsReadOnly : string -> bool
Public Function IsReadOnly (name As String) As Boolean

Parameters

name
String

要验证的配置对象的名称。The name of the configuration object to verify.

Returns

Boolean

如果 ConfigurationLockCollection 集合中指定的配置对象为只读,则为 true;否则为 falsetrue if the specified configuration object in the ConfigurationLockCollection collection is read-only; otherwise, false.

Exceptions

指定的配置对象不在集合中。The specified configuration object is not in the collection.

Examples

下面的代码示例演示如何使用 IsReadOnly 方法。The following code example demonstrates how to use the IsReadOnly method. 此代码示例是为 ConfigurationLockCollection 类提供的更大示例的一部分。This code example is part of a larger example provided for the ConfigurationLockCollection class.

// IsReadOnly method. 
Console.WriteLine("IsReadOnly: {0}",
 lockedAttribList.IsReadOnly("enabled"));
' IsReadOnly method. 
Console.WriteLine("IsReadOnly: {0}", _
 lockedAttribList.IsReadOnly("enabled"))

Applies to