다음을 통해 공유


ConfigurationElement.SetAttributeValue(String, Object) 메서드

정의

지정된 특성의 값을 설정합니다.

public:
 void SetAttributeValue(System::String ^ attributeName, System::Object ^ value);
public void SetAttributeValue (string attributeName, object value);
member this.SetAttributeValue : string * obj -> unit
Public Sub SetAttributeValue (attributeName As String, value As Object)

매개 변수

attributeName
String

변경할 특성의 이름입니다.

value
Object

특성의 새 값입니다.

예외

attributeName 매개 변수가 null이거나 비어 있는 경우

예제

다음 예제에서는 "TestDemo"라는 이름으로 요소를 수정합니다. 값이 "TestDemo(modified)"로 수정됩니다.

// Use any of the following lines to set the attribute value.
// attribute.Value = "TestDemo(Modified)";
moduleproviderelement.SetAttributeValue(
    "name", "TestDemo(Modified)");
// moduleproviderelement["name"] = "TestDemo(Modified)";

설명

이 메서드는 특성 값을 설정하고 Administration.config 파일에 씁니다. Administration.config 파일은 메서드가 CommitChanges 호출될 때까지 수정되지 않습니다.

또는 Value 속성을 사용하여 Item[] 특성 값을 설정할 수도 있습니다. 최상의 시스템 성능을 위해 메서드를 SetAttributeValue 사용해야 합니다.

적용 대상

추가 정보