milani_lucie
asked on
How to find the Size of an object in VB.NET ?
Hi
I want to find the Size of an object in VB.NET. Can you please let me know how this can be done ? Similarly I want to find the Size of a string also in VB.NET. Can you please let me know how to do that ?
Thanks
I want to find the Size of an object in VB.NET. Can you please let me know how this can be done ? Similarly I want to find the Size of a string also in VB.NET. Can you please let me know how to do that ?
Thanks
There is no way to get the size of an object in VB.NET. As for the string, the best you can do is Len(stringVariable), which returns the number of characters or then optimum number of bytes taken up by the string.
Could you be a little more specific?...what are you trying to do here? Are you working with some external API that needs the size of something?
ASKER
I will have an ParentObject with SubObjects, during runtime i need to check the size of the ParentObject. If its size is more than 100 K then i do not want to do anything. If it is less than 100 K i want to do some operations on that.
Is there something like SIZEOF() ?
Thanks
Is there something like SIZEOF() ?
Thanks
I dnt think we have something like that. we have SizeOf But its for unmanaged code.For this
http://msdn.microsoft.com/en-us/library/y3ybkfb3.aspx
Normally you can serialize into binary and get the size of that binary value
http://msdn.microsoft.com/en-us/library/y3ybkfb3.aspx
Normally you can serialize into binary and get the size of that binary value
ASKER
srikanthreddyn143:
Normally you can serialize into binary and get the size of that binary value.
Can you please provide me the sample code ? Appreciate your time and patience !
Thanks
Normally you can serialize into binary and get the size of that binary value.
Can you please provide me the sample code ? Appreciate your time and patience !
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why B Grade didn't it clear?