SecurityElement.IsValidAttributeName(String) Método
Definição
Determina se uma cadeia de caracteres é um nome de atributo válido.Determines whether a string is a valid attribute name.
public:
static bool IsValidAttributeName(System::String ^ name);
public static bool IsValidAttributeName (string name);
public static bool IsValidAttributeName (string? name);
static member IsValidAttributeName : string -> bool
Public Shared Function IsValidAttributeName (name As String) As Boolean
Parâmetros
- name
- String
O nome do atributo para testar quanto à validade.The attribute name to test for validity.
Retornos
true se o parâmetro name for um nome de atributo XML válido; caso contrário, false.true if the name parameter is a valid XML attribute name; otherwise, false.
Exemplos
O código a seguir mostra o uso do IsValidAttributeName método para determinar se uma cadeia de caracteres é um nome de atributo válido.The following code shows the use of the IsValidAttributeName method to determine whether a string is a valid attribute name. Este exemplo de código faz parte de um exemplo maior fornecido para a SecurityElement classe.This code example is part of a larger example provided for the SecurityElement class.
if ( SecurityElement::IsValidAttributeName( attributeName ) &&
SecurityElement::IsValidAttributeValue( attributeValue ) )
if (SecurityElement.IsValidAttributeName(attributeName) &&
SecurityElement.IsValidAttributeValue(attributeValue))
If SecurityElement.IsValidAttributeName(attributeName) AndAlso SecurityElement.IsValidAttributeValue(attributeValue) Then
Comentários
Esse método pode ser usado para testar um atributo antes de adicioná-lo a um elemento de segurança.This method can be used to test an attribute before adding it to a security element.