SecurityElement.Attribute(String) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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>