This documentation is archived and is not being maintained.

Marshal.PtrToStringAnsi Method

Allocates a managed String and copies all or part of an unmanaged ANSI string into it.

Overload List

Copies all characters up to the first null from an unmanaged ANSI string to a managed String. Widens each ANSI character to Unicode.

[Visual Basic] Overloads Public Shared Function PtrToStringAnsi(IntPtr) As String
[C#] public static string PtrToStringAnsi(IntPtr);
[C++] public: static String* PtrToStringAnsi(IntPtr);
[JScript] public static function PtrToStringAnsi(IntPtr) : String;

Allocates a managed String, copies a specified number of characters from an unmanaged ANSI string into it, and widens each ANSI character to Unicode.

[Visual Basic] Overloads Public Shared Function PtrToStringAnsi(IntPtr, Integer) As String
[C#] public static string PtrToStringAnsi(IntPtr, int);
[C++] public: static String* PtrToStringAnsi(IntPtr, int);
[JScript] public static function PtrToStringAnsi(IntPtr, int) : String;

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace

Show: