locked
Return ILIST(of string) RRS feed

  • Question

  • User-483047559 posted

     

    ' Returns the names of the users who aer currently in the rooms
            ''' </summary>
            ''' <returns></returns>
            Public Function GetRoomUsersNames() As Ilist(of string)
                Dim a As Object
                Dim str As IList(Of String) = Nothing
                ExpireUsers(userChatRoomSessionTimeout)
                ' MsgBox(RoomUsers.ToString())
                For Each key As Object In RoomUsers.Keys
                    'MsgBox(RoomUsers.Keys.ToString())
                    a = (Me.RoomUsers(key.ToString()).UserName)
    
                    'str.Add(a.ToString())
                    Return a
    
                Next
                  End Function
     
     
    how to return Ilist of strin that object a has username i want return that name 


    Thursday, December 2, 2010 4:11 AM

Answers

  • User1006193418 posted

    Hi,

    Why you are going to return an IList(Of String)? You can simply return a List(Of String).

            ''' </summary>
            ''' <returns></returns>
            Public Function GetRoomUsersNames() As List(of String)
                Dim a As Object
                Dim str As New List(of String) = Nothing
                ExpireUsers(userChatRoomSessionTimeout)
                ' MsgBox(RoomUsers.ToString())
                For Each key As Object In RoomUsers.Keys
                    'MsgBox(RoomUsers.Keys.ToString())
                    a = (Me.RoomUsers(key.ToString()).UserName)
    
                    str.Add(a.ToString())
                    'Return a
                Next
                Return str
            End Function

    Best Regards,
    Shengqing Yang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 8, 2010 1:19 AM