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 表示方式。

適用於