From: 011netservice@gmail.com Date: 2024-03-04, 週1 Subject: readme_Marshal.txt #### 2024-03-04, 週1 https://learn.microsoft.com/en-us/dotnet/framework/interop/marshalling-strings Marshalling Strings https://learn.microsoft.com/en-us/dotnet/standard/native-interop/customize-struct-marshalling Customize structure marshalling https://stackoverflow.com/questions/1323797/marshaling-pointer-to-an-array-of-strings Marshaling pointer to an array of strings [StructLayout(LayoutKind.Sequential)] public struct UnmanagedStruct { [MarshalAs(UnmanagedType.ByValArray, SizeConst=100)] public IntPtr[] listOfStrings; } for (int i = 0; i < 100; ++i) { if (listOfstrings[i] != IntPtr.Zero) Console.WriteLine(Marshal.PtrToStringAnsi(listOfStrings[i])); }