Convert.ToUInt32 (Object) converts object to a 32-bit unsigned integer.
Class Sample
Public Shared Sub Main()
Dim values() As Object = { True, -12, 163, 935, "x"c, #5/12/2009#, _
"104", "103.0", "-1", _
"1.00e2", "One", 1.00e2, 16.3e42}
Dim result As UInteger
For Each value As Object In values
Try
result = Convert.ToUInt32(value)
Console.WriteLine(result)
Catch e As Exception
Console.WriteLine("Exception")
End Try
Next
End Sub
End Class
Related examples in the same category