Rob*_*cks 6 vb.net types casting
我想在VB.NET中做类似下面的事情,有可能吗?
Function task(value as Object, toType as Type)
Return DirectCast(value, toType)
End Function
Run Code Online (Sandbox Code Playgroud)
Dan*_*ite 13
是.有System.Type.但是你可能真的想要做Generic.
Function SomeFunction(Of T)(obj As Object) As T
'' Magic
End Function
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13357 次 |
最近记录: |