如何在VB.NET中将整数作为unsigned参数传递?

Cod*_*ile 6 vb.net parameters unsigned

setInstance(ByVal instance As UInteger)在我的VB.NET代码中使用库调用.我需要传递的参数是Integer.有什么我需要做的事情来将整数参数转换为无符号整数吗?这个数字保证是正数且小于10.

Car*_*lin 7

像这样......

Dim MyInt As Int32 = 10
Dim MyUInt As UInt32 = CUInt(MyInt)
setInstance(MyUInt)
Run Code Online (Sandbox Code Playgroud)