我是想给目录树选中的用户发信息。原先是用列表框进行选择,因为人数太多,改为多选目录树,但两段代码没能衔接好,请老师帮忙,谢谢!
1、
Dim ss As String
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked AndAlso nd.level = 1 Then
ss = ss & "," & nd.Text
'Dim ary() As String = ss.split(",")
End If
Next
2、
'Dim ary() As String = e.Form.Controls("CheckedListBox1").Value.split(",") '复选列表框用户名
For Each s As String In Ary
'msgbox(s)
For Each u As UserInfo In Users
If s = u.Name Then
QQClient.Send(u.Group & "." & u.Name,Date.Now & "-" & User.name & "-" & "留言:" & vbcrlf & e.Form.Controls("TextBox1").text,True)
QQClient.SendChatMessage(u.Group & "." & u.Name,"{!}好友给你留言,请查看!")
End If
Next
Next