SecurityElement.Attribute(String) 메서드

정의

XML 요소에서 특성을 이름으로 찾습니다.

public:
 System::String ^ Attribute(System::String ^ name);
public string? Attribute (string name);
public string Attribute (string name);
member this.Attribute : string -> string
Public Function Attribute (name As String) As String

매개 변수

name
String

검색할 특성 이름입니다.

반환

String

이름이 지정된 특성과 연결된 값입니다. name이 포함된 특성이 존재하지 않으면 null입니다.

예외

name 매개 변수가 null인 경우

예제

다음 코드에서는 메서드를 사용하여 이름으로 특성을 찾는 방법을 보여 Attribute 있습니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 SecurityElement 클래스입니다.

String^ xmlCreationDate = xmlElement->Attribute(L"creationdate");
string xmlCreationDate = xmlElement.Attribute("creationdate");
Dim xmlCreationDate As String = xmlElement.Attribute("creationdate")

설명

다음과 같이 XML을 통해 는 Attribute("B") "456"을 반환합니다.

<thetag A="123" B="456" C="789">text</thetag>  

적용 대상