SecurityElement.Attribute(String) Método

Definição

Encontra um atributo pelo nome num elemento XML.

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

Parâmetros

name
String

O nome do atributo a procurar.

Devoluções

O valor associado ao atributo nomeado, ou null se não existir atributo com name .

Exceções

O name parâmetro é null.

Exemplos

O código seguinte mostra a utilização do Attribute método para encontrar um atributo pelo nome. Este exemplo de código faz parte de um exemplo maior fornecido para a SecurityElement classe.

string xmlCreationDate = xmlElement.Attribute("creationdate");
Dim xmlCreationDate As String = xmlElement.Attribute("creationdate")

Observações

Com XML da seguinte forma, Attribute("B") retornaria "456".

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

Aplica-se a