Re: Wants to show website users online or offline programatically via api or some class

  •  08-03-2010, 2:17 AM

    Re: Wants to show website users online or offline programatically via api or some class

    Hi Marium,
     
    1. How to know user is online or not
     
    Please try the code below
     
    1. protected override void OnLoad(EventArgs e)   
    2. {   
    3.     CuteChat.ChatPortal portal = CuteChat.AppSystem.Instance.GetCurrentPortal();   
    4.     lock (portal)   
    5.     {   
    6.         if (portal.IsMessengerStarted)   
    7.         {   
    8.             //get all users who already open cute messenger   
    9.             CuteChat.ChatPlaceUser[] users = portal.Messenger.GetAllUsers();   
    10.             foreach (CuteChat.ChatPlaceUser user in users)   
    11.             {   
    12.                 //if user!=null,it mean that user is online   
    13.                 if (user != null)   
    14.                 {   
    15.                     label1.Text += user.DisplayName;   
    16.                 }   
    17.             }   
    18.   
    19.         }   
    20.     }   
    21.     base.OnLoad(e);   
    22. }  

    2.  How to chat wiht someone directly (use some link or image)
     
     a. must add the code below in to the page
     
    <script src="CuteSoft_Client/CuteChat/IntegrationUtility.js.aspx?Chat_StartPartialMessenger=1"></script>
     
    b. The code below show you how to chat with the specified user. 'admin' is the name of the user who your want to chat.
     
     <a href="#" onclick="Chat_OpenContact('admin')">UniqueName='admin'</a>
     
    Regards,
     
    ken
View Complete Thread