Forum Discussion
Mike_Thompson_9
Nimbostratus
Aug 08, 2007CommonULong64 OverflowException
I am trying to convert the CommonULong64 type to UInt64 in .NET for a CommonStatistic type. Sometimes this works fine and I get a good number back. Other times I get a System.OverflowException. The...
Mike_Thompson_9
Nimbostratus
Aug 10, 2007I think I finally have it!
Here is the final version, uncompressed and compressed:
UnCompressed:
Public Shared Function Build64(ByVal value As Object) As UInt64
Dim ui64High As UInt64 = (value.high << 32)
Dim ui64Low As UInt64 = CLng("&H" & (Hex("&H" & Hex(value.low))))
Return Convert.ToUInt64(ui64High Or ui64Low)
End Function
Compressed:
Public Shared Function Build64(ByVal value As Object) As UInt64
Return Convert.ToUInt64((value.high << 32) Or CLng("&H" & (Hex("&H" & Hex(value.low)))))
End Function
I double checked my numbers whith what is being reported on the F5 and they are correct. Unless someone sees a problem with what I am doing, I am going with it.
Thanks for all the help so far!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects