且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将非托管IntPtr类型转换为C#字符串?

更新时间:2023-02-14 21:10:20

Marshal.PtrToStringAuto 方法(IntPtr)

Marshal.PtrToStringAuto Method (IntPtr)

分配托管的 String 并将所有字符复制到非托管内存中存储的字符串中的第一个空字符为止。

Allocates a managed String and copies all characters up to the first null character from a string stored in unmanaged memory into it.