我正在尝试制作内联键盘Telegram Bot,但是当我从c#
转换为vb.net
时发现错误:
Private Shared Function GetInlineKeyboard(ByVal stringArray As String()) As InlineKeyboardButton()()
Dim keyboardInline = New InlineKeyboardButton(0)() {}
Dim keyboardButtons = New InlineKeyboardButton(stringArray.Length - 1) {}
For i = 0 To stringArray.Length - 1
keyboardButtons(i) = New InlineKeyboardButton With {.Text = stringArray(i), .CallbackData = "Some Callback Data"}
Next
keyboardInline(0) = keyboardButtons
Return keyboardInline
End Function
此结果代码从转换c#
到vb.net
,但我收到错误:
keyboardButtons(i) = New InlineKeyboardButton With {.Text = stringArray(i), .CallbackData = "Some Callback Data"}
他们说:“初始化InlineKeyboardButton类的新实例。
'New'不能用于声明为'MustInherit'的类<“
我不知道自己要做什么。我是vb.net的新手。
抱歉我的英语不好