UIntPtr UIntPtr UIntPtr UIntPtr Struct

定義

重要

此 API 不符合 CLS 規範。

平台專用的類型,用以代表指標或控點。A platform-specific type that is used to represent a pointer or a handle.

public value class UIntPtr : System::Runtime::Serialization::ISerializable
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct UIntPtr : System.Runtime.Serialization.ISerializable
type unativeint = struct
    interface ISerializable
Public Structure UIntPtr
Implements ISerializable
繼承
屬性
實作

備註

類型UIntPtr的設計是,其大小為平臺特定的整數。The UIntPtr type is designed to be an integer whose size is platform-specific. 也就是說,此類型的實例必須是 32-32 位硬體和作業系統上的位,以及64位硬體和作業系統上的64位。That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.

重要

類型符合 CLS 規範, UIntPtr而類型不是。 IntPtrThe IntPtr type is CLS-compliant, while the UIntPtr type is not. 通用語言執行時間只會使用類型。IntPtrOnly the IntPtr type is used in the common language runtime. 類型主要是用來維護類型的IntPtr架構對稱。 UIntPtrThe UIntPtr type is provided mostly to maintain architectural symmetry with the IntPtr type.

UIntPtr類型可用於支援指標的語言,以及在執行和不支援指標的語言之間參考資料的常見方法。The UIntPtr type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers. UIntPtr物件也可以用來保存控制碼。UIntPtr objects can also be used to hold handles.

此型別代表 ISerializable 介面。This type implements the ISerializable interface.

建構函式

UIntPtr(UInt32) UIntPtr(UInt32) UIntPtr(UInt32) UIntPtr(UInt32)

使用指定的 32 位元指標或控制代碼來初始化 UIntPtr 結構的新執行個體。Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle.

UIntPtr(UInt64) UIntPtr(UInt64) UIntPtr(UInt64) UIntPtr(UInt64)

使用指定的 64 位元指標或控制代碼來初始化 UIntPtr 的新執行個體。Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle.

UIntPtr(Void*) UIntPtr(Void*) UIntPtr(Void*) UIntPtr(Void*)

對未指定的類型使用指定的指標,初始化 UIntPtr 的新執行個體。Initializes a new instance of UIntPtr using the specified pointer to an unspecified type.

欄位

Zero Zero Zero Zero

表示已經初始化為零的指標或控點之唯讀欄位。A read-only field that represents a pointer or handle that has been initialized to zero.

屬性

Size Size Size Size

取得這個執行個體的大小。Gets the size of this instance.

方法

Add(UIntPtr, Int32) Add(UIntPtr, Int32) Add(UIntPtr, Int32) Add(UIntPtr, Int32)

將不帶正負號指標的值加上位移。Adds an offset to the value of an unsigned pointer.

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

傳回值,指出這個執行個體 (Instance) 是否和指定的物件相等。Returns a value indicating whether this instance is equal to a specified object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

Subtract(UIntPtr, Int32) Subtract(UIntPtr, Int32) Subtract(UIntPtr, Int32) Subtract(UIntPtr, Int32)

將不帶正負號指標的值減去位移。Subtracts an offset from the value of an unsigned pointer.

ToPointer() ToPointer() ToPointer() ToPointer()

將這個執行個體的值轉換為未指定類型的指標。Converts the value of this instance to a pointer to an unspecified type.

ToString() ToString() ToString() ToString()

將這個執行個體的數值轉換為它的相等字串表示。Converts the numeric value of this instance to its equivalent string representation.

ToUInt32() ToUInt32() ToUInt32() ToUInt32()

將這個執行個體的值轉換為 32 位元不帶正負號的整數。Converts the value of this instance to a 32-bit unsigned integer.

ToUInt64() ToUInt64() ToUInt64() ToUInt64()

將這個執行個體的值轉換為 64 位元不帶正負號的整數。Converts the value of this instance to a 64-bit unsigned integer.

運算子

Addition(UIntPtr, Int32) Addition(UIntPtr, Int32) Addition(UIntPtr, Int32) Addition(UIntPtr, Int32)

將不帶正負號指標的值加上位移。Adds an offset to the value of an unsigned pointer.

Equality(UIntPtr, UIntPtr) Equality(UIntPtr, UIntPtr) Equality(UIntPtr, UIntPtr) Equality(UIntPtr, UIntPtr)

判斷 UIntPtr 的兩個指定執行個體是否相等。Determines whether two specified instances of UIntPtr are equal.

Explicit(Void* to UIntPtr) Explicit(Void* to UIntPtr) Explicit(Void* to UIntPtr) Explicit(Void* to UIntPtr)

將指定的指標轉換為 UIntPtr 的未指定類型。Converts the specified pointer to an unspecified type to an UIntPtr.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Explicit(UIntPtr to UInt64) Explicit(UIntPtr to UInt64) Explicit(UIntPtr to UInt64) Explicit(UIntPtr to UInt64)

將指定的 UIntPtr 值轉換為 64 位元不帶正負號的整數。Converts the value of the specified UIntPtr to a 64-bit unsigned integer.

Explicit(UIntPtr to Void*) Explicit(UIntPtr to Void*) Explicit(UIntPtr to Void*) Explicit(UIntPtr to Void*)

將指定的 UIntPtr 值轉換為未指定的類型指標。Converts the value of the specified UIntPtr to a pointer to an unspecified type.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Explicit(UInt64 to UIntPtr) Explicit(UInt64 to UIntPtr) Explicit(UInt64 to UIntPtr) Explicit(UInt64 to UIntPtr)

將 64 位元不帶正負號整數的值轉換為 UIntPtrConverts the value of a 64-bit unsigned integer to an UIntPtr.

Explicit(UInt32 to UIntPtr) Explicit(UInt32 to UIntPtr) Explicit(UInt32 to UIntPtr) Explicit(UInt32 to UIntPtr)

將 32 位元不帶正負號整數的值轉換為 UIntPtrConverts the value of a 32-bit unsigned integer to an UIntPtr.

Explicit(UIntPtr to UInt32) Explicit(UIntPtr to UInt32) Explicit(UIntPtr to UInt32) Explicit(UIntPtr to UInt32)

將指定的 UIntPtr 值轉換為 32 位元不帶正負號的整數。Converts the value of the specified UIntPtr to a 32-bit unsigned integer.

Inequality(UIntPtr, UIntPtr) Inequality(UIntPtr, UIntPtr) Inequality(UIntPtr, UIntPtr) Inequality(UIntPtr, UIntPtr)

判斷 UIntPtr 的兩個指定執行個體是否不相等。Determines whether two specified instances of UIntPtr are not equal.

Subtraction(UIntPtr, Int32) Subtraction(UIntPtr, Int32) Subtraction(UIntPtr, Int32) Subtraction(UIntPtr, Int32)

將不帶正負號指標的值減去位移。Subtracts an offset from the value of an unsigned pointer.

明確介面實作

IEquatable<UIntPtr>.Equals(UIntPtr) IEquatable<UIntPtr>.Equals(UIntPtr) IEquatable<UIntPtr>.Equals(UIntPtr) IEquatable<UIntPtr>.Equals(UIntPtr)
ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

使用序列化目前 SerializationInfo 物件所需的資料,填入 UIntPtr 物件。Populates a SerializationInfo object with the data needed to serialize the current UIntPtr object.

適用於

執行緒安全性

此型別具備執行緒安全。This type is thread safe.

另請參閱