System::Runtime::InteropServices::Marshal::PtrToStringUTF8 方法

Marshal::PtrToStringUTF8(IntPtr) method

从未管理的零终止 UTF8 字符串创建受管理的 String

static String System::Runtime::InteropServices::Marshal::PtrToStringUTF8(IntPtr ptr)
参数类型描述
ptrIntPtr指向非托管字符串的指针。

ReturnValue

托管字符串。

另见

Marshal::PtrToStringUTF8(IntPtr, int) method

从未管理的 UTF8 字符串创建受管理的 String

static String System::Runtime::InteropServices::Marshal::PtrToStringUTF8(IntPtr ptr, int length)
参数类型描述
ptrIntPtr指向非托管字符串的指针。
长度int未托管字符串的长度。

ReturnValue

托管字符串。

另见