VB.NET中如何实现函数的动态调用?
- 内容介绍
- 文章标签
- 相关推荐
本文共计186个文字,预计阅读时间需要1分钟。
在VB中,你可以通过以下方式动态调用函数来选择选项:
vbDim ver As Integer=101Select Case ver Case 101 Call upd101() Case 102 Call upd102() Case 103 Call upd103() Case Else MsgBox 未知的版本号End Select
其中,前缀为upd后跟一个ver整数,表示根据版本号调用相应的函数。
我在vb中有一个选择器Dim ver =101 Select Case ver Case 101 upd101() Case 102 upd102() Case 103 upd103() End Select
如何通过以这种形式更动态地调用函数来更好地选择此选项:
前缀为“upd”后跟一个ver整数..?
谢谢!
阿德里安
Dim t As Type = base.GetType() t.GetMethod("upd" + theInt)
本文共计186个文字,预计阅读时间需要1分钟。
在VB中,你可以通过以下方式动态调用函数来选择选项:
vbDim ver As Integer=101Select Case ver Case 101 Call upd101() Case 102 Call upd102() Case 103 Call upd103() Case Else MsgBox 未知的版本号End Select
其中,前缀为upd后跟一个ver整数,表示根据版本号调用相应的函数。
我在vb中有一个选择器Dim ver =101 Select Case ver Case 101 upd101() Case 102 upd102() Case 103 upd103() End Select
如何通过以这种形式更动态地调用函数来更好地选择此选项:
前缀为“upd”后跟一个ver整数..?
谢谢!
阿德里安
Dim t As Type = base.GetType() t.GetMethod("upd" + theInt)

