SecurityElement.IsValidAttributeName(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- name
- String
The attribute name to test for validity.
Returns
true
if the name
parameter is a valid XML attribute name; otherwise, false
.
Examples
The following code shows the use of the IsValidAttributeName method to determine whether a string is a valid attribute name. 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
Remarks
This method can be used to test an attribute before adding it to a security element.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈