OSPlatform.Equality(OSPlatform, OSPlatform) 运算符

定义

确定两个 OSPlatform 对象是否相等。Determines whether two OSPlatform objects are equal.

public:
 static bool operator ==(System::Runtime::InteropServices::OSPlatform left, System::Runtime::InteropServices::OSPlatform right);
public static bool operator == (System.Runtime.InteropServices.OSPlatform left, System.Runtime.InteropServices.OSPlatform right);
static member ( = ) : System.Runtime.InteropServices.OSPlatform * System.Runtime.InteropServices.OSPlatform -> bool
Public Shared Operator == (left As OSPlatform, right As OSPlatform) As Boolean

参数

left
OSPlatform

要比较的第一个对象。The first object to compare.

right
OSPlatform

要比较的第二个对象。The second object to compare.

返回

如果 trueleft 相等,则为 right;否则为 falsetrue if left and right are equal; otherwise, false.

注解

如果两个 OSPlatform 实例的名称相同,则这两个实例相等。Two OSPlatform instances are equal if they have the same name. OSPlatform 对象的名称是传递到 Create 方法的 osPlatform 字符串。The name of an OSPlatform object is the osPlatform string passed to the Create method. 静态 OSPlatform 属性返回的 OSPlatform 对象的名称为 "FREEBSD"、"LINUX"、"OSX" 和 "WINDOWS"。The names of the OSPlatform objects returned by the static OSPlatform properties are "FREEBSD", "LINUX", "OSX", and "WINDOWS". 方法使用序号比较来确定名称是否相同。The method uses ordinal comparison to determine whether the names are the same.

适用于