Public Sub GetDefaultValue(ByRef value As Object)
Dim type As Type = value.GetType()
value = IIf(type.IsValueType, Activator.CreateInstance(type), Nothing)
End Sub
VB获取变量的默认值
最新推荐文章于 2022-06-11 21:01:32 发布
Public Sub GetDefaultValue(ByRef value As Object)
Dim type As Type = value.GetType()
value = IIf(type.IsValueType, Activator.CreateInstance(type), Nothing)
End Sub