Size3D.GetHashCode 方法

定义

返回此 Size3D 结构的哈希代码。

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

返回

Int32

Size3D 结构的哈希代码。

示例

以下示例演示如何获取结构的哈希代码 Size3D

// Gets the hashcode of a Size3D Structure

Size3D size1 = new Size3D(2, 4, 6);
int sizeHashcode;

sizeHashcode = size1.GetHashCode();

// Displaying Results
resultType = "int";
syntaxString = "sizeHashcode = size1.GetHashCode;";
operationString = "Getting the hashcode of size1";
ShowResults(sizeHashcode.ToString(), syntaxString, resultType, operationString);
' Gets the hashcode of a Size3D Structure

Dim size1 As New Size3D(2, 4, 6)
Dim sizeHashcode As Integer

sizeHashcode = size1.GetHashCode()

' Displaying Results
resultType = "int"
syntaxString = "sizeHashcode = size1.GetHashCode"
operationString = "Getting the hashcode of size1"
ShowResults(sizeHashcode.ToString(), syntaxString, resultType, operationString)

适用于