Share via


SecurityElement.Equal(SecurityElement) 方法

定义

比较两个 XML 元素对象,确定它们是否相等。

public:
 bool Equal(System::Security::SecurityElement ^ other);
public bool Equal (System.Security.SecurityElement? other);
public bool Equal (System.Security.SecurityElement other);
member this.Equal : System.Security.SecurityElement -> bool
Public Function Equal (other As SecurityElement) As Boolean

参数

other
SecurityElement

要与当前 XML 元素对象进行比较的 XML 元素对象。

返回

如果当前 XML 元素中的标记、特性名和值、子元素以及文本字段与 other 参数中的对等部分相同,则为 true;否则为 false

示例

以下代码演示如何使用 方法比较两个 Equal XML 元素。 此代码示例是为 SecurityElement 类提供的一个更大示例的一部分。

if ( xmlElement->Equal( localXmlElement ) )
if (xmlElement.Equal(localXmlElement))
If xmlElement.Equal(localXmlElement) Then

注解

如果有子元素,则比较以递归方式扩展到它们。

不支持比较相同字符的不同 XML 表示形式。

适用于