Locate a user in CuteChat v5

Last post 06-01-2009, 3:39 PM by jbergeron9. 2 replies.
Sort Posts: Previous Next
  •  06-01-2009, 3:12 PM 52712

    Locate a user in CuteChat v5

    Can anyone tell me if there is an easy way to list the users currently accessing the CuteChat rooms in Version 5?
     
    I am sure there's a way to extract this information from the CuteChat class.  I just can't seem to find it.
     
    Thanks in advance,
     
    Jessica
  •  06-01-2009, 3:21 PM 52714 in reply to 52712

    Re: Locate a user in CuteChat v5

    Jessica,
     
    Please use the following code:
     
    1. <script runat="server">   
    2.   
    3. private void Page_Load(object sender, System.EventArgs e)   
    4. {   
    5.     if (! this.IsPostBack)   
    6.     {   
    7.         ArrayList lobbies=new ArrayList();   
    8.         foreach(LobbyInfo lobby in ChatApi.GetLobbyInfoArray())   
    9.         {   
    10.             if(lobby.Lobby.Integration==""||lobby.Lobby.Integration==null)   
    11.                 lobbies.Add(lobby);   
    12.         }   
    13.         this.DataList_Lobbies.DataSource = lobbies;   
    14.         this.DataList_Lobbies.ItemDataBound+=new DataListItemEventHandler(rptLobbies_ItemDataBound);   
    15.         this.DataList_Lobbies.DataBind();   
    16.     }   
    17.   
    18.           if (CuteChat.ChatApi.GetLobbyInfoArray().Length < 1)   
    19.               Literal1.Text = "<p align='center'><b>Please login as admin and create lobbies in the admin console!</b></p>";   
    20. }   
    21.   
    22.   
    23. private void rptLobbies_ItemDataBound(object sender, DataListItemEventArgs e)   
    24. {   
    25.     if (e.Item.DataItem == null)   
    26.     {   
    27.         return;   
    28.     }   
    29.   
    30.     LobbyInfo lobby = (LobbyInfo)e.Item.DataItem;   
    31.   
    32.                
    33.     HyperLink lnkLobby = e.Item.FindControl("lnkLobby"as HyperLink;   
    34.     lnkLobby.NavigateUrl = CuteChat.ChatWebUtility.ResolveResource(this.Context, "Channel.Aspx") + "?Place=Lobby-" + lobby.Lobby.LobbyId;   
    35.     lnkLobby.Target = "_blank";   
    36.   
    37.     String sOnlineChater = lobby.JoinClient(",");   
    38.   
    39.     Label lblOnlineChater = e.Item.FindControl("lblOnlineChater"as Label;   
    40.     lblOnlineChater.Text = lobby.ClientCount.ToString();   
    41.     lnkLobby.ToolTip = sOnlineChater;   
    42. }   
    43.   
    44. </script>  

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-01-2009, 3:39 PM 52715 in reply to 52714

    Re: Locate a user in CuteChat v5

    Thank you Adam.  That's exactly what I needed.
     
    J
View as RSS news feed in XML