SecurityElement.Attribute(String) Método

Definição

Localiza um atributo por nome em um 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 para o qual pesquisar.

Retornos

O valor associado ao atributo nomeado ou null se nenhum atributo existir name .

Exceções

O name parâmetro é null.

Exemplos

O código a seguir mostra o uso do Attribute método para localizar um atributo por 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")

Comentários

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

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

Aplica-se a