MarshalAsAttribute.SizeConst 字段

定义

指示固定长度数组中的元素数,或要导入的字符串中的字符(不是字节)数。Indicates the number of elements in the fixed-length array or the number of characters (not bytes) in a string to import.

public: int SizeConst;
public int SizeConst;
val mutable SizeConst : int
Public SizeConst As Integer 

字段值

注解

此字段对于ByValArray System.Runtime.InteropServices.UnmanagedType枚举的和ByValTStr成员是必需的。This field is required for the ByValArray and ByValTStr members of the System.Runtime.InteropServices.UnmanagedType enumeration. 由于元数据的压缩格式限制为 0x1FFFFFFF, 因此的允许值SizeConst范围为 (> = 0, < = 0x1FFFFFFF)。Because the compressed format of the metadata is limited to 0x1FFFFFFF, the range of allowed values for SizeConst are (>= 0 and <= 0x1FFFFFFF).

有关其他信息, 请参阅数组的默认封送处理For additional information, see Default Marshaling for Arrays.

适用于

另请参阅