这里我使用的是 sql server 2017 数据库,我想用我的数据库中的 2 个文件进行广播 Fild1:成员 ID Fild2:用户名
如果你想在我的广播聊天中嵌入 Usernam,你会怎么做
以下是我目前用于广播的编码循环,但它不起作用
Private Shared Async Sub Broadcash(ByVal sMessage As String)
For i As Integer = 0 To ListMember.Count - 1
Try
Await botclient.SendTextMessageAsync(ListMember(i), sMessage, Types.Enums.ParseMode.Default, False, 0, Nothing)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
MsgBox("BC Selesai", MsgBoxStyle.Information)
End Sub
Private Sub GeneratMemberID()
Me.MemberTableAdapter.Fill(Me.TelegrambotDataSet.Member)
For i As Integer = 0 To TelegrambotDataSet.Member.Rows.Count - 1
ListMember.Add(TelegrambotDataSet.Member.Rows(i).Item("MemberID"))
Next
End Sub
Private Sub GeneratUserName()
Me.MemberTableAdapter.Fill(Me.TelegrambotDataSet.Member)
For i As Integer = 0 To TelegrambotDataSet.Member.Rows.Count - 1
ListMember.Add(TelegrambotDataSet.Member.Rows(i).Item("UserName"))
Next
End Sub
'=END=
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If btnLogin.Text = "Login" Then
MsgBox("Loginkan dulu TelegramBOT anda", MsgBoxStyle.Information)
ElseIf txtPesan.Text = "" Then
MsgBox("Isi pesan tidak boleh kosong", MsgBoxStyle.Information)
Else
Broadcash(txtPesan.Text)
End If
End Sub
请帮我找到我使用 VB.Net的正确编码