VB中类似于C中"Sizeof"的功能函数是什么? RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Function LenB(Expression)返回存储一个变量所需的字节数 .NET 框架类库 Marshal.SizeOf 方法 (Object) [Visual Basic]请参见Marshal 类 | Marshal 成员 | System.Runtime.InteropServices 命名空间 | Marshal.SizeOf 重载列表 要求平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family.NET 框架安全性: SecurityPermission 用于操作非托管代码。关联的枚举:SecurityPermissionFlag.UnmanagedCode。 语言C#C++JScriptVisual Basic全部显示返回对象的非托管大小(以字节为单位)。[Visual Basic]Overloads Public Shared Function SizeOf( _ ByVal structure As Object _) As Integer[C#]public static int SizeOf( object structure);[C++]public: static int SizeOf( Object* structure);[JScript]public static function SizeOf( structure : Object) : int;参数structure 要返回其大小的对象。 返回值非托管代码中 structure 的大小。异常异常类型 条件 ArgumentException structure 不是一个 Marshal 类。 -或-structure 为数组类型。 NullReferenceException structure 为空引用(Visual Basic 中为 Nothing)。 备注返回的大小实际上是该非托管对象的大小。对象的托管大小可以不同。对于字符类型,这受应用于该类的 CharSet 值的影响。要求平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family.NET 框架安全性: SecurityPermission 用于操作非托管代码。关联的枚举:SecurityPermissionFlag.UnmanagedCode。 请参见Marshal 类 | Marshal 成员 | System.Runtime.InteropServices 命名空间 | Marshal.SizeOf 重载列表 --------------------------------------------------------------------------------将文档反馈发送给 Microsoft© 2002 Microsoft Corporation。保留所有权利。 len——对字长lenb——对字节长 len()返回unicode的字符数lenb()返回字节数,你的要求,应该用这个函数可以实现。 sizeof的参数是类型。如果没有类似的,只有先定义变量再取了。to:daliwan(百发百中大力丸)[Visual Basic]Overloads Public Shared Function SizeOf( _ ByVal structure As Object _) As Integer这个具体怎用? 请教高手如何写个类似星际魔兽的APM测试软件,非常感谢! vb如何在EXE文件头中添加代码 网页调用VB开发ACTIVEX插件问题 子报表的问题 我的Com+组件不正常,是什么原因 50分,新年派送。不够再加!!! 如何控制另一程序的Toolbar的按钮的可用性(Enable) ******200分!请问如何才能得到显示卡内存里的东西?****** 向大家推荐一个很好的学习论坛 VB问题出手-CMOS 获取当前分辨率的api是什么? 关于True Dbgrid控件
返回存储一个变量所需的字节数
Marshal 类 | Marshal 成员 | System.Runtime.InteropServices 命名空间 | Marshal.SizeOf 重载列表
要求
平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family.NET 框架安全性: SecurityPermission 用于操作非托管代码。关联的枚举:SecurityPermissionFlag.UnmanagedCode。
语言
C#C++JScriptVisual Basic全部显示
返回对象的非托管大小(以字节为单位)。[Visual Basic]
Overloads Public Shared Function SizeOf( _
ByVal structure As Object _
) As Integer
[C#]
public static int SizeOf(
object structure
);
[C++]
public: static int SizeOf(
Object* structure
);
[JScript]
public static function SizeOf(
structure : Object
) : int;
参数
structure
要返回其大小的对象。
返回值
非托管代码中 structure 的大小。异常
异常类型 条件
ArgumentException structure 不是一个 Marshal 类。
-或-structure 为数组类型。
NullReferenceException structure 为空引用(Visual Basic 中为 Nothing)。 备注
返回的大小实际上是该非托管对象的大小。对象的托管大小可以不同。对于字符类型,这受应用于该类的 CharSet 值的影响。要求
平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family.NET 框架安全性: SecurityPermission 用于操作非托管代码。关联的枚举:SecurityPermissionFlag.UnmanagedCode。
请参见
Marshal 类 | Marshal 成员 | System.Runtime.InteropServices 命名空间 | Marshal.SizeOf 重载列表 --------------------------------------------------------------------------------将文档反馈发送给 Microsoft© 2002 Microsoft Corporation。保留所有权利。
lenb——对字节长
[Visual Basic]
Overloads Public Shared Function SizeOf( _
ByVal structure As Object _
) As Integer
这个具体怎用?