Guid.Equals Guid.Equals Guid.Equals Guid.Equals Method

定义

返回一个值,该值指示 Guid 的两个实例是否表示同一个值。Returns a value that indicates whether two instances of Guid represent the same value.

重载

Equals(Guid) Equals(Guid) Equals(Guid) Equals(Guid)

返回一个值,该值指示此实例和指定的 Guid 对象是否表示相同的值。Returns a value indicating whether this instance and a specified Guid object represent the same value.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

Equals(Guid) Equals(Guid) Equals(Guid) Equals(Guid)

返回一个值,该值指示此实例和指定的 Guid 对象是否表示相同的值。Returns a value indicating whether this instance and a specified Guid object represent the same value.

public:
 virtual bool Equals(Guid g);
public bool Equals (Guid g);
override this.Equals : Guid -> bool
Public Function Equals (g As Guid) As Boolean

参数

g
Guid Guid Guid Guid

要与此实例进行比较的对象。An object to compare to this instance.

返回

如果 true 与此实例相等,则为 g;否则为 falsetrue if g is equal to this instance; otherwise, false.

实现

注解

如果Guid两个对象具有相同的字节值,则这两个对象相等。Two Guid objects are equal if they have identical byte values.

此方法的执行效果略优于Equals方法,因为它不需要对g参数进行框。This method performs slightly better than the Equals method because it does not have to box the g parameter.

另请参阅

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

public:
 override bool Equals(System::Object ^ o);
public override bool Equals (object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

参数

o
Object Object Object Object

与该实例进行比较的对象。The object to compare with this instance.

返回

如果 o 是值与此实例相等的 Guid,则为 true;否则为 falsetrue if o is a Guid that has the same value as this instance; otherwise, false.

注解

如果Guid两个对象具有相同的字节值,则这两个对象相等。Two Guid objects are equal if they have identical byte values.

适用于