以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]怎样把多选目录树的选中节点设为数组  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=110326)

--  作者:天一生水
--  发布时间:2017/11/30 22:59:00
--  [求助]怎样把多选目录树的选中节点设为数组

如题,怎样设为数组?

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


--  作者:有点甜
--  发布时间:2017/11/30 23:19:00
--  

为什么要设置成数组?用集合不可以?

 

http://www.foxtable.com/webhelp/scr/0217.htm

 


--  作者:天一生水
--  发布时间:2017/11/30 23:31:00
--  

我是想给目录树选中的用户发信息。原先是用列表框进行选择,因为人数太多,改为多选目录树,但两段代码没能衔接好,请老师帮忙,谢谢!

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


--  作者:有点蓝
--  发布时间:2017/12/1 8:56:00
--  

If nd.Checked AndAlso nd.level = 1 Then
        Dim ary() As String = nd.fullpath.split("\\") 

 QQClient.Send(ary(0) & "." & ary(1),Date.Now & "-" & User.name & "-" & "留言:" & vbcrlf & e.Form.Controls("TextBox1").text,True)      

 

    End If