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 元素对象。

返回

true 如果当前 XML 元素中的标记、属性名称和值、子元素和文本字段与参数中的 other 对应字段相同,则为 ;否则为 false

示例

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

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

注解

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

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

适用于